diff --git a/src/view/com/util/images/AutoSizedImage.tsx b/src/view/com/util/images/AutoSizedImage.tsx index fedc9432..80cd0fa9 100644 --- a/src/view/com/util/images/AutoSizedImage.tsx +++ b/src/view/com/util/images/AutoSizedImage.tsx @@ -48,15 +48,23 @@ export function AutoSizedImage({ }, [imgInfo, containerInfo]) useEffect(() => { + let aborted = false Image.getSize( uri, (width: number, height: number) => { - setImgInfo({width, height}) + if (!aborted) { + setImgInfo({width, height}) + } }, (error: any) => { - setError(String(error)) + if (!aborted) { + setError(String(error)) + } }, ) + return () => { + aborted = true + } }, [uri]) const onLayout = (evt: LayoutChangeEvent) => {