Skip to content

Commit

Permalink
Fix fetch loader stats marked as aborted after loaded
Browse files Browse the repository at this point in the history
Fixes #3789
  • Loading branch information
Rob Walch committed Apr 19, 2021
1 parent d31cc5b commit ff96e79
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/utils/fetch-loader.ts
Expand Up @@ -51,8 +51,11 @@ class FetchLoader implements Loader<LoaderContext> {
}

abortInternal(): void {
this.stats.aborted = true;
this.controller.abort();
const response = this.response;
if (!response || !response.ok) {
this.stats.aborted = true;
this.controller.abort();
}
}

abort(): void {
Expand Down

0 comments on commit ff96e79

Please sign in to comment.