workletize a function that wasn't getting autoworkletized anymore (#8309)
This commit is contained in:
@@ -510,20 +510,22 @@ function LightboxImage({
|
|||||||
// This is a bug in Reanimated, but for now we'll work around it like this.
|
// This is a bug in Reanimated, but for now we'll work around it like this.
|
||||||
dismissSwipeTranslateY.set(1)
|
dismissSwipeTranslateY.set(1)
|
||||||
}
|
}
|
||||||
dismissSwipeTranslateY.set(() =>
|
dismissSwipeTranslateY.set(() => {
|
||||||
withDecay({
|
'worklet'
|
||||||
|
return withDecay({
|
||||||
velocity: e.velocityY,
|
velocity: e.velocityY,
|
||||||
velocityFactor: Math.max(3500 / Math.abs(e.velocityY), 1), // Speed up if it's too slow.
|
velocityFactor: Math.max(3500 / Math.abs(e.velocityY), 1), // Speed up if it's too slow.
|
||||||
deceleration: 1, // Danger! This relies on the reaction below stopping it.
|
deceleration: 1, // Danger! This relies on the reaction below stopping it.
|
||||||
}),
|
})
|
||||||
)
|
})
|
||||||
} else {
|
} else {
|
||||||
dismissSwipeTranslateY.set(() =>
|
dismissSwipeTranslateY.set(() => {
|
||||||
withSpring(0, {
|
'worklet'
|
||||||
|
return withSpring(0, {
|
||||||
stiffness: 700,
|
stiffness: 700,
|
||||||
damping: 50,
|
damping: 50,
|
||||||
}),
|
})
|
||||||
)
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user