load first page on read manga (#76)

This commit is contained in:
Aria Moradi
2021-11-15 12:53:18 +03:30
committed by GitHub
parent 72ef61e286
commit 0eedbe6626
3 changed files with 10 additions and 11 deletions

View File

@@ -87,8 +87,9 @@ export default function HorizontalPager(props: IReaderProps) {
};
useEffect(() => {
// scroll last read page into view after first mount
pagesRef.current[curPage]?.scrollIntoView({ inline: 'center' });
}, [settings.readerType]);
}, [pagesRef.current.length]);
useEffect(() => {
selfRef.current?.addEventListener('mousedown', dragControl);