Update src/components/Lightbox/pager/ImagePager.tsx
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
This commit is contained in:
@@ -253,6 +253,9 @@ function ImageView({
|
|||||||
const dismissSwipeTranslateY = useSharedValue(0)
|
const dismissSwipeTranslateY = useSharedValue(0)
|
||||||
const isFlyingAway = useSharedValue(false)
|
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
|
// Hold the neighbor window at 0 until the open animation completes, so we
|
||||||
// only decode the active image during the most memory-constrained moment.
|
// only decode the active image during the most memory-constrained moment.
|
||||||
// Mirrors the orientation-unlock gate below.
|
// 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(() => {
|
const containerStyle = useAnimatedStyle(() => {
|
||||||
if (openProgress.get() < 1) {
|
if (openProgress.get() < 1) {
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user