From 0572ee3371163f5531d9db807bdb9d6cd9d20704 Mon Sep 17 00:00:00 2001 From: Tim Date: Tue, 25 Feb 2025 10:36:17 +0100 Subject: [PATCH] fix(Library): continue watching mode was broken --- src/routes/Library/Library.js | 56 +++++++++++++++++------------------ 1 file changed, 28 insertions(+), 28 deletions(-) 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 }) => { { - model === 'library' ? - library.selected === null ? - -
- {' -
{model === 'library' ? 'Library' : 'Continue Watching'} not loaded!
-
-
+ library.selected === null ? + +
+ {' +
{model === 'library' ? 'Library' : 'Continue Watching'} not loaded!
+
+
+ : + library.catalog.length === 0 ? +
+ {' +
Empty {model === 'library' ? 'Library' : 'Continue Watching'}
+
: - library.catalog.length === 0 ? -
- {' -
Empty {model === 'library' ? 'Library' : 'Continue Watching'}
-
- : -
- {library.catalog.map((libItem, index) => ( +
+ { + library.catalog.map((libItem, index) => ( - ))} -
- : null + )) + } +
} :