Shared:MediaViewer Added handling for image loading interruptions
This commit is contained in:
parent
edd1d4bd8a
commit
3fdd6cfc5a
@ -951,6 +951,16 @@ export const ImageViewer = ({
|
||||
};
|
||||
}, []);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
return () => {
|
||||
if (imgRef.current) {
|
||||
// abort img loading
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
imgRef.current.src = "";
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<>
|
||||
{isMobile && !backgroundBlack && mobileDetails}
|
||||
|
Loading…
Reference in New Issue
Block a user