Add option to disable transition pages

The previous/next transition page of the first/last chapter will still be shown to indicate that there is no previous/next chapter
This commit is contained in:
schroda
2025-05-05 01:26:27 +02:00
parent eb23f74a40
commit f0f740f4af
9 changed files with 99 additions and 11 deletions

View File

@@ -84,6 +84,7 @@ const BaseReaderTransitionPage = ({
transitionPageMode,
readingMode,
backgroundColor,
shouldShowTransitionPage,
manga,
currentChapterName,
currentChapterScanlator,
@@ -95,7 +96,7 @@ const BaseReaderTransitionPage = ({
scrollbarYSize,
readerNavBarWidth,
handleBack,
}: Pick<IReaderSettings, 'readingMode' | 'backgroundColor'> &
}: Pick<IReaderSettings, 'readingMode' | 'backgroundColor' | 'shouldShowTransitionPage'> &
Pick<TReaderStateMangaContext, 'manga'> &
Pick<TReaderScrollbarContext, 'scrollbarXSize' | 'scrollbarYSize'> &
Pick<ReaderStatePages, 'transitionPageMode'> &
@@ -120,6 +121,15 @@ const BaseReaderTransitionPage = ({
const isFirstChapter = !!currentChapterName && !previousChapterName;
const isLastChapter = !!currentChapterName && !nextChapterName;
const forceShowFirstChapterPreviousTransitionPage = isFirstChapter && type === ReaderTransitionPageMode.PREVIOUS;
const forceShowLastChapterNextTransitionPage = isLastChapter && type === ReaderTransitionPageMode.NEXT;
const forceShowTransitionPage =
forceShowFirstChapterPreviousTransitionPage || forceShowLastChapterNextTransitionPage;
if (!shouldShowTransitionPage && !forceShowTransitionPage) {
return null;
}
if (!isTransitionPageVisible(type, transitionPageMode, readingMode)) {
return null;
}
@@ -290,5 +300,6 @@ export const ReaderTransitionPage = withPropsFrom(
'transitionPageMode',
'readingMode',
'handleBack',
'shouldShowTransitionPage',
],
);