Skip to content

Commit

Permalink
Fix check for fetch abortion error (#668)
Browse files Browse the repository at this point in the history
  • Loading branch information
schroda authored Mar 24, 2024
1 parent a96038b commit 1d49945
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/util/SpinnerImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ export const SpinnerImage = forwardRef((props: IProps, imgRef: ForwardedRef<HTML
updateImageState(true);
await updateImage();
} catch (e) {
const wasAborted = e instanceof Error && e.name === 'AbortError';
const wasAborted =
e instanceof Error && (e.name === 'AbortError' || e.message === 'Component was unmounted');
updateImageState(false, !wasAborted);
}
};
Expand Down

0 comments on commit 1d49945

Please sign in to comment.