mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-21 03:22:11 +00:00
refactor(Library): scrollTop effect condition
This commit is contained in:
parent
ffe420aeec
commit
fa3677b5dd
1 changed files with 2 additions and 2 deletions
|
|
@ -59,10 +59,10 @@ const Library = ({ model, urlParams, queryParams }) => {
|
||||||
}, [hasNextPage, loadNextPage]);
|
}, [hasNextPage, loadNextPage]);
|
||||||
const onScroll = useOnScrollToBottom(onScrollToBottom, SCROLL_TO_BOTTOM_TRESHOLD);
|
const onScroll = useOnScrollToBottom(onScrollToBottom, SCROLL_TO_BOTTOM_TRESHOLD);
|
||||||
React.useLayoutEffect(() => {
|
React.useLayoutEffect(() => {
|
||||||
if (library.selected && library.selected.request.page === 1 && profile.auth !== null) {
|
if (profile.auth !== null && library.selected && library.selected.request.page === 1) {
|
||||||
scrollContainerRef.current.scrollTop = 0;
|
scrollContainerRef.current.scrollTop = 0;
|
||||||
}
|
}
|
||||||
}, [library.selected]);
|
}, [profile.auth, library.selected]);
|
||||||
return (
|
return (
|
||||||
<MainNavBars className={styles['library-container']} route={model}>
|
<MainNavBars className={styles['library-container']} route={model}>
|
||||||
<div className={styles['library-content']}>
|
<div className={styles['library-content']}>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue