From 6b48844c19e77ba3a7a746eb79c7c38097d6e904 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Mon, 10 Feb 2025 01:33:41 +0100 Subject: [PATCH] Fix current page index for leading/trailing chapter --- src/modules/reader/utils/Reader.utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/reader/utils/Reader.utils.ts b/src/modules/reader/utils/Reader.utils.ts index b0084bfe..f20dcf07 100644 --- a/src/modules/reader/utils/Reader.utils.ts +++ b/src/modules/reader/utils/Reader.utils.ts @@ -278,11 +278,11 @@ export const getReaderChapterViewerCurrentPageIndex = ( return getInitialReaderPageIndex(visibleChapters.resumeMode, 0, chapter.pageCount - 1); } - if (isTrailingChapter) { + if (isLeadingChapter) { return Math.max(0, chapter.pageCount - 1); } - if (isLeadingChapter) { + if (isTrailingChapter) { return 0; } }