Fix current page index for leading/trailing chapter

This commit is contained in:
schroda
2025-02-10 22:40:50 +01:00
parent 174d850093
commit 6b48844c19
+2 -2
View File
@@ -278,11 +278,11 @@ export const getReaderChapterViewerCurrentPageIndex = (
return getInitialReaderPageIndex(visibleChapters.resumeMode, 0, chapter.pageCount - 1); return getInitialReaderPageIndex(visibleChapters.resumeMode, 0, chapter.pageCount - 1);
} }
if (isTrailingChapter) { if (isLeadingChapter) {
return Math.max(0, chapter.pageCount - 1); return Math.max(0, chapter.pageCount - 1);
} }
if (isLeadingChapter) { if (isTrailingChapter) {
return 0; return 0;
} }
} }