fix: prevent returning to previous book when exiting reader after auto-advance
Some checks failed
Build, Push & Deploy / deploy (push) Has been cancelled

Use router.replace instead of router.push when auto-advancing to next book,
so closing the reader navigates back to the series view instead of the previous book.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-22 10:29:39 +01:00
parent c5da33d6b2
commit 8cdbebaafb

View File

@@ -99,7 +99,7 @@ export function usePageNavigation({
const handleNextPage = useCallback(() => {
if (currentPage === pages.length) {
if (nextBook) {
router.push(`/books/${nextBook.id}`);
router.replace(`/books/${nextBook.id}`);
return;
}
setShowEndMessage(true);