fix(library): fixed occasional freeze when navigating back to the library (#2485)
Closes #2482.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user