fix(library): fixed occasional freeze when navigating back to the library (#2485)
Closes #2482.
This commit is contained in:
@@ -2,9 +2,8 @@
|
||||
|
||||
import '@/utils/polyfill';
|
||||
import i18n from '@/i18n/i18n';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { useEffect } from 'react';
|
||||
import { IconContext } from 'react-icons';
|
||||
import { usePathname } from 'next/navigation';
|
||||
import { AuthProvider } from '@/context/AuthContext';
|
||||
import { useEnv } from '@/context/EnvContext';
|
||||
import { CSPostHogProvider } from '@/context/PHContext';
|
||||
@@ -28,16 +27,6 @@ const Providers = ({ children }: { children: React.ReactNode }) => {
|
||||
const iconSize = useDefaultIconSize();
|
||||
useSafeAreaInsets(); // Initialize safe area insets
|
||||
|
||||
const pathname = usePathname();
|
||||
const prevPathnameRef = useRef<string | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
if (prevPathnameRef.current !== null) {
|
||||
sessionStorage.setItem('lastPath', prevPathnameRef.current);
|
||||
}
|
||||
prevPathnameRef.current = pathname;
|
||||
}, [pathname]);
|
||||
|
||||
useEffect(() => {
|
||||
const handlerLanguageChanged = (lng: string) => {
|
||||
document.documentElement.lang = lng;
|
||||
|
||||
Reference in New Issue
Block a user