Update src/routes/Library/Library.js

Co-authored-by: Timothy Z. <117831817+kKaskak@users.noreply.github.com>
This commit is contained in:
Tim 2024-03-13 18:12:49 +01:00 committed by GitHub
parent 455c8e314c
commit 571bc391e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -59,7 +59,7 @@ const Library = ({ model, urlParams, queryParams }) => {
}, [hasNextPage, loadNextPage]);
const onScroll = useOnScrollToBottom(onScrollToBottom, SCROLL_TO_BOTTOM_TRESHOLD);
React.useLayoutEffect(() => {
if (library.selected && library.selected.request.page === 1) {
if (library.selected && library.selected.request.page === 1 && profile.auth !== null) {
scrollContainerRef.current.scrollTop = 0;
}
}, [library.selected]);