Simplify ReaderControls#useHandleClick

This commit is contained in:
schroda
2025-09-20 20:00:16 +02:00
parent ca5920919e
commit 5730690ae6
3 changed files with 43 additions and 62 deletions

View File

@@ -175,8 +175,6 @@ const BaseReaderViewer = forwardRef(
scrollbar.setYSize(scrollbarYSize);
}, [scrollbarXSize, scrollbarYSize]);
const handleClick = ReaderControls.useHandleClick(scrollElementRef.current);
const imageRefs = useRef<(HTMLElement | null)[]>(pages.map(() => null));
const [{ minChapterViewWidth, minChapterViewHeight, minChapterSizeSourceChapterId }, setChapterViewerSize] =
useState({
@@ -320,7 +318,7 @@ const BaseReaderViewer = forwardRef(
}),
}),
}}
onClick={(e) => !isDragging && handleClick(e)}
onClick={(e) => !isDragging && ReaderControls.handleClick(scrollElementRef.current, e)}
onScroll={() =>
ReaderControls.updateCurrentPageOnScroll(
imageRefs,