Always use "secondary page index" as "current page index" when available
There was an issue where one had to click twice at the end of a chapter in the "double page mode" to get to the chapter transition page. This was caused due to setting the "primary page index" as the "current page index" and thus, when opening the next page, it got changed to the "secondary page index". However, this page was already visible and therefore, there was no visual change.
This commit is contained in:
@@ -13,7 +13,7 @@ import { useMemo } from 'react';
|
||||
import FormControl from '@mui/material/FormControl';
|
||||
import InputLabel from '@mui/material/InputLabel';
|
||||
import { Select } from '@/modules/core/components/inputs/Select.tsx';
|
||||
import { getPage } from '@/modules/reader/utils/ReaderProgressBar.utils.tsx';
|
||||
import { getNextIndexFromPage, getPage } from '@/modules/reader/utils/ReaderProgressBar.utils.tsx';
|
||||
import { ReaderStatePages } from '@/modules/reader/types/ReaderProgressBar.types.ts';
|
||||
import { ReaderControls } from '@/modules/reader/services/ReaderControls.ts';
|
||||
import { useGetOptionForDirection } from '@/modules/theme/services/ThemeCreator.ts';
|
||||
@@ -50,7 +50,7 @@ export const ReaderNavBarDesktopPageNavigation = ({
|
||||
<Select
|
||||
labelId="reader-nav-bar-desktop-page-select"
|
||||
label={t('reader.page_info.label.page')}
|
||||
value={currentPage.primary.index}
|
||||
value={getNextIndexFromPage(currentPage)}
|
||||
onChange={(e) => openPage(e.target.value as number)}
|
||||
>
|
||||
{pages.map(({ primary: { index }, name }) => (
|
||||
|
||||
Reference in New Issue
Block a user