Fix auto scroll related tsc issues
This commit is contained in:
@@ -879,6 +879,7 @@
|
|||||||
},
|
},
|
||||||
"exit_mode": "Open page on exit",
|
"exit_mode": "Open page on exit",
|
||||||
"hotkey": {
|
"hotkey": {
|
||||||
|
"auto_scroll": "Toggle auto scroll",
|
||||||
"menu": "Toggle menu",
|
"menu": "Toggle menu",
|
||||||
"next_chapter": "Next chapter",
|
"next_chapter": "Next chapter",
|
||||||
"next_page": "Next page",
|
"next_page": "Next page",
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ const READER_HOTKEY_TO_TITLE: Record<ReaderHotkey, TranslationKey> = {
|
|||||||
[ReaderHotkey.OFFSET_SPREAD_PAGES]: 'reader.settings.hotkey.offset_spread_pages',
|
[ReaderHotkey.OFFSET_SPREAD_PAGES]: 'reader.settings.hotkey.offset_spread_pages',
|
||||||
[ReaderHotkey.CYCLE_READING_MODE]: 'reader.settings.hotkey.reading_mode',
|
[ReaderHotkey.CYCLE_READING_MODE]: 'reader.settings.hotkey.reading_mode',
|
||||||
[ReaderHotkey.CYCLE_READING_DIRECTION]: 'reader.settings.hotkey.reading_direction',
|
[ReaderHotkey.CYCLE_READING_DIRECTION]: 'reader.settings.hotkey.reading_direction',
|
||||||
|
[ReaderHotkey.TOGGLE_AUTO_SCROLL]: 'reader.settings.hotkey.auto_scroll',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const ReaderSettingHotkey = ({
|
export const ReaderSettingHotkey = ({
|
||||||
|
|||||||
@@ -11,9 +11,13 @@ import { TReaderAutoScrollContext } from '@/modules/reader/types/Reader.types.ts
|
|||||||
|
|
||||||
export const ReaderAutoScrollContext = createContext<TReaderAutoScrollContext>({
|
export const ReaderAutoScrollContext = createContext<TReaderAutoScrollContext>({
|
||||||
isActive: false,
|
isActive: false,
|
||||||
|
isPaused: false,
|
||||||
setScrollRef: () => {},
|
setScrollRef: () => {},
|
||||||
start: () => {},
|
start: () => {},
|
||||||
cancel: () => {},
|
cancel: () => {},
|
||||||
|
toggleActive: () => {},
|
||||||
|
pause: () => {},
|
||||||
|
resume: () => {},
|
||||||
});
|
});
|
||||||
|
|
||||||
export const useReaderAutoScrollContext = () => useContext(ReaderAutoScrollContext);
|
export const useReaderAutoScrollContext = () => useContext(ReaderAutoScrollContext);
|
||||||
|
|||||||
Reference in New Issue
Block a user