diff --git a/src/components/reader/hooks/usePageNavigation.ts b/src/components/reader/hooks/usePageNavigation.ts index 5ed56de..465b31c 100644 --- a/src/components/reader/hooks/usePageNavigation.ts +++ b/src/components/reader/hooks/usePageNavigation.ts @@ -98,6 +98,7 @@ export const usePageNavigation = ({ ); const handlePreviousPage = useCallback(() => { + if (currentPage === 1) return; if (isDoublePage && shouldShowDoublePage(currentPage - 2)) { navigateToPage(Math.max(1, currentPage - 2)); } else { @@ -106,6 +107,7 @@ export const usePageNavigation = ({ }, [currentPage, isDoublePage, navigateToPage, shouldShowDoublePage]); const handleNextPage = useCallback(() => { + if (currentPage === pages.length) return; if (isDoublePage && shouldShowDoublePage(currentPage)) { navigateToPage(Math.min(pages.length, currentPage + 2)); } else {