feat: no vertical swipe on reader

This commit is contained in:
Julien Froidefond
2025-02-16 22:47:52 +01:00
parent 4761b47198
commit a4b52a1ee8
2 changed files with 5 additions and 1 deletions

View File

@@ -101,9 +101,13 @@ export const usePageNavigation = ({
if (touchStartXRef.current === null) return;
const touchEndX = event.changedTouches[0].clientX;
const touchEndY = event.changedTouches[0].clientY;
const deltaX = touchEndX - touchStartXRef.current;
const deltaY = Math.abs(touchEndY - event.touches[0].clientY);
const minSwipeDistance = 50;
if (deltaY > Math.abs(deltaX)) return;
if (Math.abs(deltaX) > minSwipeDistance) {
if (deltaX > 0) {
handlePreviousPage();