Add option to disable "infinite chapter scroll"

This commit is contained in:
schroda
2025-04-26 23:19:01 +02:00
parent f9930b94ca
commit beda5096d1
10 changed files with 67 additions and 20 deletions

View File

@@ -240,6 +240,7 @@ export const useReaderInfiniteScrollUpdateChapter = (
isChapterToOpenVisible: boolean,
readingMode: ReadingMode,
readingDirection: ReadingDirection,
shouldUseInfiniteScroll: boolean,
openChapter: ReturnType<typeof ReaderControls.useOpenChapter>,
image: HTMLElement | null,
scrollbarXSize: number,
@@ -250,7 +251,11 @@ export const useReaderInfiniteScrollUpdateChapter = (
image,
useCallback(
(entries) => {
if (!isContinuousReadingMode(readingMode) || chapterToOpenId === undefined) {
if (
!shouldUseInfiniteScroll ||
!isContinuousReadingMode(readingMode) ||
chapterToOpenId === undefined
) {
return;
}
@@ -297,6 +302,7 @@ export const useReaderInfiniteScrollUpdateChapter = (
isChapterToOpenVisible,
readingMode,
readingDirection,
shouldUseInfiniteScroll,
openChapter,
scrollbarXSize,
scrollbarYSize,