Skip to content

Commit

Permalink
fix(android): cancelling of long process requests fix
Browse files Browse the repository at this point in the history
  • Loading branch information
farfromrefug committed May 17, 2022
1 parent 387cdaf commit e46b698
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/request.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -342,13 +342,13 @@ function getClient(reload: boolean = false, timeout: number = 10): okhttp3.OkHtt
}

export function cancelRequest(tag: string, client: okhttp3.OkHttpClient = runningClients[tag]) {
if (!client) {
return;
}
if (notClosedResponses[tag]) {
notClosedResponses[tag].cancel();
return;
}
if (!client) {
return;
}
const dispatcher = client.dispatcher();
//When you want to cancel:
//A) go through the queued calls and cancel if the tag matches:
Expand Down

0 comments on commit e46b698

Please sign in to comment.