From b2bfe1e376f42e20ddc8fdda8011b61b4450b178 Mon Sep 17 00:00:00 2001 From: Ell1ott <85990359+Ell1ott@users.noreply.github.com> Date: Sun, 22 Dec 2024 20:35:09 +1300 Subject: [PATCH] Dismiss animation based on delay --- app/components/swipe-card.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/components/swipe-card.tsx b/app/components/swipe-card.tsx index 186d915..364033f 100644 --- a/app/components/swipe-card.tsx +++ b/app/components/swipe-card.tsx @@ -62,8 +62,10 @@ function SwipeCard({ card, index, totalCards, onDismiss, setIsAnimating }: Swipe velocity: event.velocityX, damping: 15 }, () => { - runOnJS(onDismiss)(direction); }); + runOnJS(() => setTimeout(() => { + onDismiss(direction); + }, 200))(); translateY.value = withSpring(-100, { damping: 250 }); } else { console.log('reset');