Fix check for fetch abortion error (#668)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user