From 07d77a47903583f9858d121f65bd8572b1aa3456 Mon Sep 17 00:00:00 2001 From: tienifr Date: Thu, 15 Feb 2024 00:13:53 +0700 Subject: [PATCH] fix uncache image --- src/components/ImageWithSizeCalculation.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/ImageWithSizeCalculation.tsx b/src/components/ImageWithSizeCalculation.tsx index 344904796f31..eb30d857aaa4 100644 --- a/src/components/ImageWithSizeCalculation.tsx +++ b/src/components/ImageWithSizeCalculation.tsx @@ -47,11 +47,14 @@ function ImageWithSizeCalculation({url, style, onMeasure, isAuthTokenRequired}: const onError = () => { Log.hmmm('Unable to fetch image to calculate size', {url}); + if (isLoadedRef.current) { + isLoadedRef.current = false; + setIsImageCached(false); + } if (isOffline) { return; } setIsLoading(false); - setIsImageCached(true); }; const imageLoadedSuccessfully = (event: OnLoadNativeEvent) => {