Fix "Tried to synchronously call a Remote Function" crash (#11517)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
+4
-4
@@ -124,14 +124,14 @@ export function Splash(props: React.PropsWithChildren<Props>) {
|
|||||||
if (isReady) {
|
if (isReady) {
|
||||||
SplashScreen.hideAsync()
|
SplashScreen.hideAsync()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
intro.set(() =>
|
intro.set(
|
||||||
withTiming(
|
withTiming(
|
||||||
1,
|
1,
|
||||||
{duration: 400, easing: Easing.out(Easing.cubic)},
|
{duration: 400, easing: Easing.out(Easing.cubic)},
|
||||||
() => {
|
() => {
|
||||||
'worklet'
|
'worklet'
|
||||||
// set these values to check animation at specific point
|
// set these values to check animation at specific point
|
||||||
outroLogo.set(() =>
|
outroLogo.set(
|
||||||
withTiming(
|
withTiming(
|
||||||
1,
|
1,
|
||||||
{duration: 1200, easing: Easing.in(Easing.cubic)},
|
{duration: 1200, easing: Easing.in(Easing.cubic)},
|
||||||
@@ -140,13 +140,13 @@ export function Splash(props: React.PropsWithChildren<Props>) {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
outroApp.set(() =>
|
outroApp.set(
|
||||||
withTiming(1, {
|
withTiming(1, {
|
||||||
duration: 1200,
|
duration: 1200,
|
||||||
easing: Easing.inOut(Easing.cubic),
|
easing: Easing.inOut(Easing.cubic),
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
outroAppOpacity.set(() =>
|
outroAppOpacity.set(
|
||||||
withTiming(1, {
|
withTiming(1, {
|
||||||
duration: 1200,
|
duration: 1200,
|
||||||
easing: Easing.in(Easing.cubic),
|
easing: Easing.in(Easing.cubic),
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ export function AvatarBubbles({
|
|||||||
if (!animate) return
|
if (!animate) return
|
||||||
const animateBubble = (p: SharedValue<number>, i: number) => {
|
const animateBubble = (p: SharedValue<number>, i: number) => {
|
||||||
p.set(0)
|
p.set(0)
|
||||||
p.set(() =>
|
p.set(
|
||||||
withDelay(
|
withDelay(
|
||||||
500 + i * 100,
|
500 + i * 100,
|
||||||
withTiming(1, {
|
withTiming(1, {
|
||||||
|
|||||||
@@ -119,16 +119,12 @@ export default function ImageViewRoot({
|
|||||||
|
|
||||||
// https://github.com/software-mansion/react-native-reanimated/issues/6677
|
// https://github.com/software-mansion/react-native-reanimated/issues/6677
|
||||||
rAF_FIXED(() => {
|
rAF_FIXED(() => {
|
||||||
openProgress.set(() =>
|
openProgress.set(isAnimated ? withClampedSpring(1, SLOW_SPRING) : 1)
|
||||||
isAnimated ? withClampedSpring(1, SLOW_SPRING) : 1,
|
|
||||||
)
|
|
||||||
})
|
})
|
||||||
return () => {
|
return () => {
|
||||||
// https://github.com/software-mansion/react-native-reanimated/issues/6677
|
// https://github.com/software-mansion/react-native-reanimated/issues/6677
|
||||||
rAF_FIXED(() => {
|
rAF_FIXED(() => {
|
||||||
openProgress.set(() =>
|
openProgress.set(isAnimated ? withClampedSpring(0, SLOW_SPRING) : 0)
|
||||||
isAnimated ? withClampedSpring(0, SLOW_SPRING) : 0,
|
|
||||||
)
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}, [nextLightbox, openProgress, thumbRects])
|
}, [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.
|
// 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(
|
||||||
'worklet'
|
withDecay({
|
||||||
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.
|
||||||
reduceMotion: ReduceMotion.Never, // If this animation doesn't run, the image gets stuck - therefore override Reduce Motion
|
reduceMotion: ReduceMotion.Never, // If this animation doesn't run, the image gets stuck - therefore override Reduce Motion
|
||||||
})
|
}),
|
||||||
})
|
)
|
||||||
} else {
|
} else {
|
||||||
dismissSwipeTranslateY.set(() => {
|
dismissSwipeTranslateY.set(
|
||||||
'worklet'
|
withSpring(0, {
|
||||||
return withSpring(0, {
|
|
||||||
stiffness: 700,
|
stiffness: 700,
|
||||||
damping: 50,
|
damping: 50,
|
||||||
mass: 1,
|
mass: 1,
|
||||||
reduceMotion: ReduceMotion.Never,
|
reduceMotion: ReduceMotion.Never,
|
||||||
})
|
}),
|
||||||
})
|
)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ export function Loader(props: Props) {
|
|||||||
}))
|
}))
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
rotation.set(() =>
|
rotation.set(
|
||||||
withRepeat(withTiming(360, {duration: 500, easing: Easing.linear}), -1),
|
withRepeat(withTiming(360, {duration: 500, easing: Easing.linear}), -1),
|
||||||
)
|
)
|
||||||
}, [rotation])
|
}, [rotation])
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ export const ProgressGuideToast = forwardRef<
|
|||||||
|
|
||||||
// animate the opacity then set isOpen to false when done
|
// animate the opacity then set isOpen to false when done
|
||||||
const setIsntOpen = () => setIsOpen(false)
|
const setIsntOpen = () => setIsOpen(false)
|
||||||
opacity.set(() =>
|
opacity.set(
|
||||||
withTiming(
|
withTiming(
|
||||||
0,
|
0,
|
||||||
{
|
{
|
||||||
@@ -81,7 +81,7 @@ export const ProgressGuideToast = forwardRef<
|
|||||||
// animate the vertical translation, the opacity, and the checkmark
|
// animate the vertical translation, the opacity, and the checkmark
|
||||||
const playCheckmark = () => animatedCheckRef.current?.play()
|
const playCheckmark = () => animatedCheckRef.current?.play()
|
||||||
opacity.set(0)
|
opacity.set(0)
|
||||||
opacity.set(() =>
|
opacity.set(
|
||||||
withTiming(
|
withTiming(
|
||||||
1,
|
1,
|
||||||
{
|
{
|
||||||
@@ -92,7 +92,7 @@ export const ProgressGuideToast = forwardRef<
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
translateY.set(0)
|
translateY.set(0)
|
||||||
translateY.set(() =>
|
translateY.set(
|
||||||
withTiming(insets.top + 10, {
|
withTiming(insets.top + 10, {
|
||||||
duration: 500,
|
duration: 500,
|
||||||
easing: Easing.out(Easing.cubic),
|
easing: Easing.out(Easing.cubic),
|
||||||
|
|||||||
@@ -41,10 +41,8 @@ export const AnimatedCheck = forwardRef<AnimatedCheckRef, AnimatedCheckProps>(
|
|||||||
circleAnim.set(0)
|
circleAnim.set(0)
|
||||||
checkAnim.set(0)
|
checkAnim.set(0)
|
||||||
|
|
||||||
circleAnim.set(() =>
|
circleAnim.set(withTiming(1, {duration: 500, easing: Easing.linear}))
|
||||||
withTiming(1, {duration: 500, easing: Easing.linear}),
|
checkAnim.set(
|
||||||
)
|
|
||||||
checkAnim.set(() =>
|
|
||||||
withDelay(
|
withDelay(
|
||||||
500,
|
500,
|
||||||
withTiming(1, {duration: 300, easing: Easing.linear}, cb),
|
withTiming(1, {duration: 300, easing: Easing.linear}, cb),
|
||||||
|
|||||||
@@ -32,12 +32,12 @@ export function NewMessagesPill({
|
|||||||
|
|
||||||
const onPressIn = useCallback(() => {
|
const onPressIn = useCallback(() => {
|
||||||
if (IS_WEB) return
|
if (IS_WEB) return
|
||||||
scale.set(() => withTiming(1.075, {duration: 100}))
|
scale.set(withTiming(1.075, {duration: 100}))
|
||||||
}, [scale])
|
}, [scale])
|
||||||
|
|
||||||
const onPressOut = useCallback(() => {
|
const onPressOut = useCallback(() => {
|
||||||
if (IS_WEB) return
|
if (IS_WEB) return
|
||||||
scale.set(() => withTiming(1, {duration: 100}))
|
scale.set(withTiming(1, {duration: 100}))
|
||||||
}, [scale])
|
}, [scale])
|
||||||
|
|
||||||
const onPress = useCallback(() => {
|
const onPress = useCallback(() => {
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ export function SwipeToReply({
|
|||||||
const runPop = () => {
|
const runPop = () => {
|
||||||
'worklet'
|
'worklet'
|
||||||
if (isReducedMotion) return
|
if (isReducedMotion) return
|
||||||
iconScale.set(() =>
|
iconScale.set(
|
||||||
withSequence(
|
withSequence(
|
||||||
withTiming(1.2, {duration: 175}),
|
withTiming(1.2, {duration: 175}),
|
||||||
withTiming(1, {duration: 100}),
|
withTiming(1, {duration: 100}),
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ export function GestureActionView({
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
iconScale.set(() =>
|
iconScale.set(
|
||||||
withSequence(
|
withSequence(
|
||||||
withTiming(1.2, {duration: 175}),
|
withTiming(1.2, {duration: 175}),
|
||||||
withTiming(1, {duration: 100}),
|
withTiming(1, {duration: 100}),
|
||||||
@@ -205,7 +205,7 @@ export function GestureActionView({
|
|||||||
scheduleOnRN(actions.rightFirst.action)
|
scheduleOnRN(actions.rightFirst.action)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
transX.set(() => withTiming(0, {duration: 200}))
|
transX.set(withTiming(0, {duration: 200}))
|
||||||
hitFirst.set(false)
|
hitFirst.set(false)
|
||||||
hitSecond.set(false)
|
hitSecond.set(false)
|
||||||
isActive.set(false)
|
isActive.set(false)
|
||||||
|
|||||||
@@ -45,14 +45,14 @@ export function PressableScale({
|
|||||||
onPressIn(e)
|
onPressIn(e)
|
||||||
}
|
}
|
||||||
cancelAnimation(scale)
|
cancelAnimation(scale)
|
||||||
scale.set(() => withTiming(targetScale, {duration: 100}))
|
scale.set(withTiming(targetScale, {duration: 100}))
|
||||||
}}
|
}}
|
||||||
onPressOut={e => {
|
onPressOut={e => {
|
||||||
if (onPressOut) {
|
if (onPressOut) {
|
||||||
onPressOut(e)
|
onPressOut(e)
|
||||||
}
|
}
|
||||||
cancelAnimation(scale)
|
cancelAnimation(scale)
|
||||||
scale.set(() => withTiming(1, {duration: 100}))
|
scale.set(withTiming(1, {duration: 100}))
|
||||||
}}
|
}}
|
||||||
style={[!reducedMotion && animatedStyle, style]}
|
style={[!reducedMotion && animatedStyle, style]}
|
||||||
{...rest}>
|
{...rest}>
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ export function Provider({children}: React.PropsWithChildren<{}>) {
|
|||||||
const setModeWorklet = useCallback(
|
const setModeWorklet = useCallback(
|
||||||
(v: boolean) => {
|
(v: boolean) => {
|
||||||
'worklet'
|
'worklet'
|
||||||
footerMode.set(() =>
|
footerMode.set(
|
||||||
withSpring(v ? 1 : 0, {
|
withSpring(v ? 1 : 0, {
|
||||||
...Reanimated3DefaultSpringConfig,
|
...Reanimated3DefaultSpringConfig,
|
||||||
overshootClamping: true,
|
overshootClamping: true,
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ export function MainScrollProvider({children}: {children: React.ReactNode}) {
|
|||||||
const setMode = useCallback(
|
const setMode = useCallback(
|
||||||
(v: boolean) => {
|
(v: boolean) => {
|
||||||
'worklet'
|
'worklet'
|
||||||
headerMode.set(() =>
|
headerMode.set(
|
||||||
withSpring(v ? 1 : 0, {
|
withSpring(v ? 1 : 0, {
|
||||||
...Reanimated3DefaultSpringConfig,
|
...Reanimated3DefaultSpringConfig,
|
||||||
overshootClamping: true,
|
overshootClamping: true,
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ function HomeScreenReady({
|
|||||||
const headerMode = useHomeHeaderMode()
|
const headerMode = useHomeHeaderMode()
|
||||||
const showHeader = useCallback(() => {
|
const showHeader = useCallback(() => {
|
||||||
'worklet'
|
'worklet'
|
||||||
headerMode.set(() =>
|
headerMode.set(
|
||||||
withSpring(0, {
|
withSpring(0, {
|
||||||
...Reanimated3DefaultSpringConfig,
|
...Reanimated3DefaultSpringConfig,
|
||||||
overshootClamping: true,
|
overshootClamping: true,
|
||||||
|
|||||||
Reference in New Issue
Block a user