From e2f06e2bd2ea44f46035fa877009a5c62d3e8285 Mon Sep 17 00:00:00 2001 From: Hailey Date: Wed, 1 May 2024 18:30:35 -0700 Subject: [PATCH] dont trigger if animation is cancelled --- src/components/dms/GrowWrapper.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/dms/GrowWrapper.tsx b/src/components/dms/GrowWrapper.tsx index 4999c0e23a..0880a79e12 100644 --- a/src/components/dms/GrowWrapper.tsx +++ b/src/components/dms/GrowWrapper.tsx @@ -37,11 +37,14 @@ export const GrowWrapper = React.forwardRef(function GrowWrapper( const reset = useCallback(() => { cancelAnimation(scale) + animationDidComplete.value = false scale.value = withTiming(1, {duration: 200}) - }, [scale]) + }, [animationDidComplete, scale]) const onTouchStart = React.useCallback(() => { - scale.value = withTiming(1.05, {duration: 750}, () => { + scale.value = withTiming(1.05, {duration: 750}, finished => { + if (!finished) return + animationDidComplete.value = true runOnJS(onOpenMenu)() })