Properly disable previous/next page desktop overlay buttons in double page mode

For the double page mode the secondary page index gets used.
This was changed with 9a8655db2f, however, this occurrence was overlooked
This commit is contained in:
schroda
2024-12-13 02:29:27 +01:00
parent aaf7fb7b30
commit e425b8f304

View File

@@ -39,8 +39,8 @@ export const ReaderNavBarDesktopPageNavigation = ({
type="previous"
title={t(getOptionForDirection('reader.button.previous_page', 'reader.button.next_page', direction))}
disabled={getOptionForDirection(
!currentPageIndex,
currentPage.primary.index === pages.slice(-1)[0].primary.index,
!currentPage.primary.index,
getNextIndexFromPage(currentPage) === getNextIndexFromPage(pages.slice(-1)[0]),
direction,
)}
onClick={() => openPage('previous', undefined, false)}
@@ -64,8 +64,8 @@ export const ReaderNavBarDesktopPageNavigation = ({
type="next"
title={t(getOptionForDirection('reader.button.next_page', 'reader.button.previous_page', direction))}
disabled={getOptionForDirection(
currentPage.primary.index === pages.slice(-1)[0].primary.index,
!currentPageIndex,
getNextIndexFromPage(currentPage) === getNextIndexFromPage(pages.slice(-1)[0]),
!currentPage.primary.index,
direction,
)}
onClick={() => openPage('next', undefined, false)}