Prevent opening previous/next chapter on page selection
In case the first/last page was opened and a specific page was selected, instead of opening the page, the previous/next chapter was opened due to incorrectly handling the page change as a previous/next page change
This commit is contained in:
@@ -278,6 +278,14 @@ export class ReaderControls {
|
|||||||
setIsOverlayVisible(false);
|
setIsOverlayVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const hideTransitionPage = () => setTransitionPageMode(ReaderTransitionPageMode.NONE);
|
||||||
|
|
||||||
|
if (typeof page === 'number') {
|
||||||
|
setPageToScrollToIndex(page);
|
||||||
|
hideTransitionPage();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const shouldOpenPreviousChapter =
|
const shouldOpenPreviousChapter =
|
||||||
isFirstPage && isATransitionPageVisible && convertedPage === 'previous' && !!previousChapter;
|
isFirstPage && isATransitionPageVisible && convertedPage === 'previous' && !!previousChapter;
|
||||||
if (shouldOpenPreviousChapter) {
|
if (shouldOpenPreviousChapter) {
|
||||||
@@ -292,14 +300,6 @@ export class ReaderControls {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const hideTransitionPage = () => setTransitionPageMode(ReaderTransitionPageMode.NONE);
|
|
||||||
|
|
||||||
if (typeof page === 'number') {
|
|
||||||
setPageToScrollToIndex(page);
|
|
||||||
hideTransitionPage();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const needToHideTransitionPage = isATransitionPageVisible && !isContinuousReadingModeActive;
|
const needToHideTransitionPage = isATransitionPageVisible && !isContinuousReadingModeActive;
|
||||||
switch (convertedPage) {
|
switch (convertedPage) {
|
||||||
case 'previous':
|
case 'previous':
|
||||||
|
|||||||
Reference in New Issue
Block a user