diff --git a/src/components/Lightbox/pager/ImagePager.tsx b/src/components/Lightbox/pager/ImagePager.tsx index 2b9a135a17..455cb26bc5 100644 --- a/src/components/Lightbox/pager/ImagePager.tsx +++ b/src/components/Lightbox/pager/ImagePager.tsx @@ -253,6 +253,9 @@ function ImageView({ const dismissSwipeTranslateY = useSharedValue(0) const isFlyingAway = useSharedValue(false) + // Hold the neighbor window at 0 until the open animation completes, so we + // only decode the active image during the most memory-constrained moment. + // Mirrors the orientation-unlock gate below. // Hold the neighbor window at 0 until the open animation completes, so we // only decode the active image during the most memory-constrained moment. // Mirrors the orientation-unlock gate below. @@ -265,6 +268,14 @@ function ImageView({ }, ) + // On a rotation remount openProgress is already 1, so the reaction above + // never sees a change; seed the flag directly for that case. + useEffect(() => { + if (openProgress.get() === 1) { + setHasFullyOpened(true) + } + }, [openProgress]) + const containerStyle = useAnimatedStyle(() => { if (openProgress.get() < 1) { return {