fix(library): fixed occasional freeze when navigating back to the library (#2485)

Closes #2482.
This commit is contained in:
Huang Xin
2025-11-20 10:45:49 +05:30
committed by GitHub
parent f8e21dbd4c
commit 3c1a7eac86
3 changed files with 9 additions and 16 deletions
+4 -4
View File
@@ -82,10 +82,10 @@ export const navigateToLibrary = (
navOptions?: { scroll?: boolean },
navBack?: boolean,
) => {
const lastPath = typeof window !== 'undefined' ? sessionStorage.getItem('lastPath') : null;
if (navBack && lastPath === '/library') {
router.back();
return;
const lastLibraryParams =
typeof window !== 'undefined' ? sessionStorage.getItem('lastLibraryParams') : null;
if (navBack && lastLibraryParams) {
queryParams = lastLibraryParams;
}
router.replace(`/library${queryParams ? `?${queryParams}` : ''}`, navOptions);