about summary refs log tree commit diff
path: root/src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.android.tsx
diff options
context:
space:
mode:
authordan <dan.abramov@gmail.com>2024-11-10 20:30:31 +0000
committerGitHub <noreply@github.com>2024-11-10 20:30:31 +0000
commitb4412f333381504f6e93ebbfb3f2b9fa9dab892d (patch)
tree92519d12008628b7869830b78d4df1f69f020204 /src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.android.tsx
parent89c93313a3fc3123a2e53856f53cc8cea8e693fa (diff)
downloadvoidsky-b4412f333381504f6e93ebbfb3f2b9fa9dab892d.tar.zst
Fix render loop on Android (#6213)
Diffstat (limited to 'src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.android.tsx')
-rw-r--r--src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.android.tsx12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.android.tsx b/src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.android.tsx
index 4652cb606..260787d2f 100644
--- a/src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.android.tsx
+++ b/src/view/com/lightbox/ImageViewing/components/ImageItem/ImageItem.android.tsx
@@ -396,10 +396,14 @@ const ImageItem = ({
                 placeholderContentFit="cover"
                 placeholder={{uri: imageSrc.thumbUri}}
                 accessibilityLabel={imageSrc.alt}
-                onLoad={e => {
-                  setHasLoaded(true)
-                  onLoad({width: e.source.width, height: e.source.height})
-                }}
+                onLoad={
+                  hasLoaded
+                    ? undefined
+                    : e => {
+                        setHasLoaded(true)
+                        onLoad({width: e.source.width, height: e.source.height})
+                      }
+                }
                 style={{flex: 1, borderRadius}}
                 accessibilityHint=""
                 accessibilityIgnoresInvertColors