Skip to content

Commit 9b2dd77

Browse files
authored
fix: image gallery issues (#2835)
* fix: infinite image loading issue * fix: image gallery animations issue
1 parent b0fda59 commit 9b2dd77

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

package/src/components/Attachment/Gallery.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ const GalleryImageThumbnail = <
458458
setLoadingImage(false);
459459
setLoadingImageError(true);
460460
}}
461-
onLoadEnd={() => setLoadingImage(false)}
461+
onLoadEnd={() => setTimeout(() => setLoadingImage(false), 0)}
462462
onLoadStart={() => setLoadingImage(true)}
463463
resizeMode={thumbnail.resizeMode}
464464
style={[

package/src/components/ImageGallery/hooks/useAnimatedGalleryStyle.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ export const useAnimatedGalleryStyle = ({
7272
{ scaleX: -1 },
7373
{ translateY: yScaleOffset },
7474
{
75-
translateX: -translateX.value - xScaleOffset,
75+
translateX: -xScaleOffset,
7676
},
7777
{ scale: oneEighth },
7878
],
7979
};
80-
}, []);
80+
}, [index]);
8181

8282
return [animatedGalleryStyle, animatedStyles];
8383
};

0 commit comments

Comments
 (0)