Skip to content

Commit

Permalink
Merge pull request #3801 from video-dev/bugfix/fetch-loader-aborted-s…
Browse files Browse the repository at this point in the history
…tatus

Fix fetch loader stats marked as aborted after loaded
  • Loading branch information
robwalch committed Apr 20, 2021
2 parents 40374b4 + ff96e79 commit c35441b
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 c35441b

Please sign in to comment.