diff --git a/src/modules/reader/components/viewer/ReaderViewer.tsx b/src/modules/reader/components/viewer/ReaderViewer.tsx index 1d03b493..b462e127 100644 --- a/src/modules/reader/components/viewer/ReaderViewer.tsx +++ b/src/modules/reader/components/viewer/ReaderViewer.tsx @@ -103,6 +103,7 @@ const BaseReaderViewer = forwardRef( pageGap, customFilter, shouldStretchPage, + isStaticNav, readerNavBarWidth, setScrollbarXSize, setScrollbarYSize, @@ -144,6 +145,7 @@ const BaseReaderViewer = forwardRef( | 'pageGap' | 'customFilter' | 'shouldStretchPage' + | 'isStaticNav' > & Pick & Pick & @@ -282,7 +284,7 @@ const BaseReaderViewer = forwardRef( setShowPreview, scrollElementRef, ); - useReaderAutoScroll(isOverlayVisible, automaticScrolling); + useReaderAutoScroll(isOverlayVisible, automaticScrolling, isStaticNav); useReaderPreserveScrollPosition( scrollElementRef, currentChapter?.id, @@ -479,6 +481,7 @@ export const ReaderViewer = withPropsFrom( 'pageGap', 'customFilter', 'shouldStretchPage', + 'isStaticNav', 'readerNavBarWidth', 'transitionPageMode', 'setScrollbarXSize', diff --git a/src/modules/reader/hooks/useReaderAutoScroll.ts b/src/modules/reader/hooks/useReaderAutoScroll.ts index 3bef081a..a65f2030 100644 --- a/src/modules/reader/hooks/useReaderAutoScroll.ts +++ b/src/modules/reader/hooks/useReaderAutoScroll.ts @@ -8,17 +8,19 @@ import { useEffect } from 'react'; import { useAutomaticScrolling } from '@/modules/core/hooks/useAutomaticScrolling.ts'; +import { IReaderSettings } from '@/modules/reader/types/Reader.types.ts'; export const useReaderAutoScroll = ( isOverlayVisible: boolean, automaticScrolling: ReturnType, + isStaticNav: IReaderSettings['isStaticNav'], ): void => { useEffect(() => { - if (isOverlayVisible) { + if (isOverlayVisible && !isStaticNav) { automaticScrolling.pause(); return; } automaticScrolling.resume(); - }, [isOverlayVisible, automaticScrolling.isPaused]); + }, [isOverlayVisible, automaticScrolling.isPaused, isStaticNav]); };