Skip to content

Commit

Permalink
chore: 변수 명 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
wokbjso committed Oct 14, 2024
1 parent ccaae8f commit fec5eac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions hooks/use-swipe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ export function useSwipe({
if (touchStartX === null) return;

const touchEndX = e.changedTouches[0].clientX;
const totalMove = Math.abs(touchStartX - touchEndX);
const deltaX = touchStartX - touchEndX;

if (totalMove > threshold) {
if (totalMove > 0) {
if (Math.abs(deltaX) > threshold) {
if (deltaX > 0) {
onSwipeLeft?.();
} else {
onSwipeRight?.();
Expand Down

0 comments on commit fec5eac

Please sign in to comment.