diff --git a/src/routes/Library/Library.js b/src/routes/Library/Library.js
index 74f272b52..f22a12236 100644
--- a/src/routes/Library/Library.js
+++ b/src/routes/Library/Library.js
@@ -59,7 +59,7 @@ const Library = ({ model, urlParams, queryParams }) => {
}, [hasNextPage, loadNextPage]);
const onScroll = useOnScrollToBottom(onScrollToBottom, SCROLL_TO_BOTTOM_TRESHOLD);
React.useLayoutEffect(() => {
- if (profile.auth !== null && library.selected && library.selected.request.page === 1 && library.catalog.length !== 0) {
+ if (scrollContainerRef.current !== null && library.selected && library.selected.request.page === 1 && library.catalog.length !== 0) {
scrollContainerRef.current.scrollTop = 0;
}
}, [profile.auth, library.selected]);
@@ -73,35 +73,35 @@ const Library = ({ model, urlParams, queryParams }) => {