Fix check for fetch abortion error (#668)

This commit is contained in:
schroda
2024-03-24 15:03:29 +01:00
committed by GitHub
parent a96038bcb7
commit 1d49945caa

View File

@@ -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);
}
};