Hide overlay on page/scroll change

This commit is contained in:
schroda
2024-12-11 21:04:44 +01:00
parent 8b67c2d6a9
commit 8ca0af8d02
4 changed files with 33 additions and 5 deletions

View File

@@ -73,7 +73,7 @@ export const ReaderHotkeys = ({
const readerThemeDirection = ReaderService.useGetThemeDirection();
const { enableScope, disableScope } = useHotkeysContext();
const { manga } = useReaderStateMangaContext();
const { isVisible, setIsVisible } = useReaderOverlayContext();
const { isVisible, setIsVisible: setIsOverlayVisible } = useReaderOverlayContext();
const {
hotkeys,
pageScaleMode,
@@ -105,6 +105,7 @@ export const ReaderHotkeys = ({
themeDirection,
scrollElementRef.current,
openChapter,
setIsOverlayVisible,
ReaderScrollAmount.SMALL,
),
{ preventDefault: true },
@@ -122,6 +123,7 @@ export const ReaderHotkeys = ({
themeDirection,
scrollElementRef.current,
openChapter,
setIsOverlayVisible,
ReaderScrollAmount.SMALL,
),
{ preventDefault: true },
@@ -137,7 +139,7 @@ export const ReaderHotkeys = ({
() => openChapter(getOptionForDirection('next', 'previous', readerThemeDirection)),
[openChapter, readerThemeDirection],
);
useHotkeys(hotkeys[ReaderHotkey.TOGGLE_MENU], () => setIsVisible(!isVisible), [isVisible]);
useHotkeys(hotkeys[ReaderHotkey.TOGGLE_MENU], () => setIsOverlayVisible(!isVisible), [isVisible]);
useHotkeys(
hotkeys[ReaderHotkey.CYCLE_SCALE_TYPE],
() => {