Simplify ReaderControls#useOpenPage

This commit is contained in:
schroda
2025-09-20 19:56:31 +02:00
parent f5c7379fc4
commit ca5920919e
5 changed files with 94 additions and 127 deletions

View File

@@ -67,10 +67,8 @@ export const ReaderHotkeys = ({
}));
const exitReader = ReaderService.useExit();
const openPage = ReaderControls.useOpenPage();
useHotkeys(hotkeys[ReaderHotkey.PREVIOUS_PAGE], () => openPage('previous'), [openPage]);
useHotkeys(hotkeys[ReaderHotkey.NEXT_PAGE], () => openPage('next'), [openPage]);
useHotkeys(hotkeys[ReaderHotkey.PREVIOUS_PAGE], () => ReaderControls.openPage('previous'));
useHotkeys(hotkeys[ReaderHotkey.NEXT_PAGE], () => ReaderControls.openPage('next'));
useHotkeys(
hotkeys[ReaderHotkey.SCROLL_BACKWARD],
() => {