Shared:MediaViewer Added handling for image loading interruptions

This commit is contained in:
Akmal Isomadinov 2024-08-06 14:50:52 +05:00
parent edd1d4bd8a
commit 3fdd6cfc5a

View File

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