Skip to content

Commit e46b698

Browse files
committed
fix(android): cancelling of long process requests fix
1 parent 387cdaf commit e46b698

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/request.android.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,13 +342,13 @@ function getClient(reload: boolean = false, timeout: number = 10): okhttp3.OkHtt
342342
}
343343

344344
export function cancelRequest(tag: string, client: okhttp3.OkHttpClient = runningClients[tag]) {
345-
if (!client) {
346-
return;
347-
}
348345
if (notClosedResponses[tag]) {
349346
notClosedResponses[tag].cancel();
350347
return;
351348
}
349+
if (!client) {
350+
return;
351+
}
352352
const dispatcher = client.dispatcher();
353353
//When you want to cancel:
354354
//A) go through the queued calls and cancel if the tag matches:

0 commit comments

Comments
 (0)