forked from mystiq/hydrogen-web
also abort timeout timer when response is rejected
This commit is contained in:
parent
4ffaa82435
commit
4de29779c7
1 changed files with 2 additions and 1 deletions
|
@ -78,7 +78,8 @@ export class HomeServerApi {
|
|||
() => {} // ignore AbortError
|
||||
);
|
||||
// abort timeout if request finishes first
|
||||
requestResult.response().then(() => timeout.abort());
|
||||
const abort = () => timeout.abort();
|
||||
requestResult.response().then(abort, abort);
|
||||
}
|
||||
|
||||
const wrapper = new RequestWrapper(method, url, requestResult);
|
||||
|
|
Loading…
Reference in a new issue