fix: avoid pagination until book view is inited, closes #1983 (#1994)

This commit is contained in:
Huang Xin
2025-09-07 20:47:35 +08:00
committed by GitHub
parent 70a7f5be19
commit 71c2143cba
4 changed files with 25 additions and 3 deletions
@@ -38,13 +38,16 @@ export const usePagination = (
containerRef: React.RefObject<HTMLDivElement>,
) => {
const { appService } = useEnv();
const { getViewSettings } = useReaderStore();
const { getViewSettings, getViewState } = useReaderStore();
const { hoveredBookKey, setHoveredBookKey } = useReaderStore();
const { acquireVolumeKeyInterception, releaseVolumeKeyInterception } = useDeviceControlStore();
const handlePageFlip = async (
msg: MessageEvent | CustomEvent | React.MouseEvent<HTMLDivElement, MouseEvent>,
) => {
const viewState = getViewState(bookKey);
if (!viewState?.inited) return;
if (msg instanceof MessageEvent) {
if (msg.data && msg.data.bookKey === bookKey) {
const viewSettings = getViewSettings(bookKey)!;