mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-04-21 07:32:02 +00:00
fix: library crashing when 0 items are present
This commit is contained in:
parent
27c8263d8d
commit
b9bc10498d
1 changed files with 1 additions and 1 deletions
|
|
@ -57,7 +57,7 @@ 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 (profile.auth !== null && library.selected && library.selected.request.page === 1) {
|
if (profile.auth !== null && library.selected && library.selected.request.page === 1 && library.catalog.length !== 0 ) {
|
||||||
scrollContainerRef.current.scrollTop = 0;
|
scrollContainerRef.current.scrollTop = 0;
|
||||||
}
|
}
|
||||||
}, [profile.auth, library.selected]);
|
}, [profile.auth, library.selected]);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue