Fix "Tried to synchronously call a Remote Function" crash (#11517)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -72,7 +72,7 @@ export function AvatarBubbles({
|
||||
if (!animate) return
|
||||
const animateBubble = (p: SharedValue<number>, i: number) => {
|
||||
p.set(0)
|
||||
p.set(() =>
|
||||
p.set(
|
||||
withDelay(
|
||||
500 + i * 100,
|
||||
withTiming(1, {
|
||||
|
||||
@@ -119,16 +119,12 @@ export default function ImageViewRoot({
|
||||
|
||||
// https://github.com/software-mansion/react-native-reanimated/issues/6677
|
||||
rAF_FIXED(() => {
|
||||
openProgress.set(() =>
|
||||
isAnimated ? withClampedSpring(1, SLOW_SPRING) : 1,
|
||||
)
|
||||
openProgress.set(isAnimated ? withClampedSpring(1, SLOW_SPRING) : 1)
|
||||
})
|
||||
return () => {
|
||||
// https://github.com/software-mansion/react-native-reanimated/issues/6677
|
||||
rAF_FIXED(() => {
|
||||
openProgress.set(() =>
|
||||
isAnimated ? withClampedSpring(0, SLOW_SPRING) : 0,
|
||||
)
|
||||
openProgress.set(isAnimated ? withClampedSpring(0, SLOW_SPRING) : 0)
|
||||
})
|
||||
}
|
||||
}, [nextLightbox, openProgress, thumbRects])
|
||||
@@ -591,25 +587,23 @@ function LightboxImage({
|
||||
// This is a bug in Reanimated, but for now we'll work around it like this.
|
||||
dismissSwipeTranslateY.set(1)
|
||||
}
|
||||
dismissSwipeTranslateY.set(() => {
|
||||
'worklet'
|
||||
return withDecay({
|
||||
dismissSwipeTranslateY.set(
|
||||
withDecay({
|
||||
velocity: e.velocityY,
|
||||
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.
|
||||
reduceMotion: ReduceMotion.Never, // If this animation doesn't run, the image gets stuck - therefore override Reduce Motion
|
||||
})
|
||||
})
|
||||
}),
|
||||
)
|
||||
} else {
|
||||
dismissSwipeTranslateY.set(() => {
|
||||
'worklet'
|
||||
return withSpring(0, {
|
||||
dismissSwipeTranslateY.set(
|
||||
withSpring(0, {
|
||||
stiffness: 700,
|
||||
damping: 50,
|
||||
mass: 1,
|
||||
reduceMotion: ReduceMotion.Never,
|
||||
})
|
||||
})
|
||||
}),
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ export function Loader(props: Props) {
|
||||
}))
|
||||
|
||||
useEffect(() => {
|
||||
rotation.set(() =>
|
||||
rotation.set(
|
||||
withRepeat(withTiming(360, {duration: 500, easing: Easing.linear}), -1),
|
||||
)
|
||||
}, [rotation])
|
||||
|
||||
@@ -62,7 +62,7 @@ export const ProgressGuideToast = forwardRef<
|
||||
|
||||
// animate the opacity then set isOpen to false when done
|
||||
const setIsntOpen = () => setIsOpen(false)
|
||||
opacity.set(() =>
|
||||
opacity.set(
|
||||
withTiming(
|
||||
0,
|
||||
{
|
||||
@@ -81,7 +81,7 @@ export const ProgressGuideToast = forwardRef<
|
||||
// animate the vertical translation, the opacity, and the checkmark
|
||||
const playCheckmark = () => animatedCheckRef.current?.play()
|
||||
opacity.set(0)
|
||||
opacity.set(() =>
|
||||
opacity.set(
|
||||
withTiming(
|
||||
1,
|
||||
{
|
||||
@@ -92,7 +92,7 @@ export const ProgressGuideToast = forwardRef<
|
||||
),
|
||||
)
|
||||
translateY.set(0)
|
||||
translateY.set(() =>
|
||||
translateY.set(
|
||||
withTiming(insets.top + 10, {
|
||||
duration: 500,
|
||||
easing: Easing.out(Easing.cubic),
|
||||
|
||||
@@ -41,10 +41,8 @@ export const AnimatedCheck = forwardRef<AnimatedCheckRef, AnimatedCheckProps>(
|
||||
circleAnim.set(0)
|
||||
checkAnim.set(0)
|
||||
|
||||
circleAnim.set(() =>
|
||||
withTiming(1, {duration: 500, easing: Easing.linear}),
|
||||
)
|
||||
checkAnim.set(() =>
|
||||
circleAnim.set(withTiming(1, {duration: 500, easing: Easing.linear}))
|
||||
checkAnim.set(
|
||||
withDelay(
|
||||
500,
|
||||
withTiming(1, {duration: 300, easing: Easing.linear}, cb),
|
||||
|
||||
@@ -32,12 +32,12 @@ export function NewMessagesPill({
|
||||
|
||||
const onPressIn = useCallback(() => {
|
||||
if (IS_WEB) return
|
||||
scale.set(() => withTiming(1.075, {duration: 100}))
|
||||
scale.set(withTiming(1.075, {duration: 100}))
|
||||
}, [scale])
|
||||
|
||||
const onPressOut = useCallback(() => {
|
||||
if (IS_WEB) return
|
||||
scale.set(() => withTiming(1, {duration: 100}))
|
||||
scale.set(withTiming(1, {duration: 100}))
|
||||
}, [scale])
|
||||
|
||||
const onPress = useCallback(() => {
|
||||
|
||||
@@ -78,7 +78,7 @@ export function SwipeToReply({
|
||||
const runPop = () => {
|
||||
'worklet'
|
||||
if (isReducedMotion) return
|
||||
iconScale.set(() =>
|
||||
iconScale.set(
|
||||
withSequence(
|
||||
withTiming(1.2, {duration: 175}),
|
||||
withTiming(1, {duration: 100}),
|
||||
|
||||
Reference in New Issue
Block a user