Skip to content

Commit

Permalink
Merge pull request #108 from gunnartorfis/android-onclick-action
Browse files Browse the repository at this point in the history
  • Loading branch information
hyoban authored Sep 19, 2024
2 parents 4cfe534 + 9fcab35 commit c3ddc08
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/gestures.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ export const ToastSwipeHandler: React.FC<
const threshold = direction === 'left' ? -WINDOW_WIDTH * 0.25 : -16;
const shouldDismiss = translate.value < threshold;

if (Math.abs(translate.value) < 16) {
translate.value = withTiming(0, {
easing: Easing.elastic(0.8),
});
return;
}

if (shouldDismiss) {
translate.value = withTiming(
-WINDOW_WIDTH,
Expand Down

0 comments on commit c3ddc08

Please sign in to comment.