feat: no vertical swipe on reader
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user