Improve responsive layouts and streamline page loading
All checks were successful
Deploy MineGeo to Dokploy / deploy (push) Successful in 8m58s
All checks were successful
Deploy MineGeo to Dokploy / deploy (push) Successful in 8m58s
This commit is contained in:
@@ -32,6 +32,7 @@ export function SiteSettingsProvider({
|
||||
const version = useRef(0);
|
||||
const pending = useRef(false);
|
||||
const pathname = usePathname();
|
||||
const previousPathname = useRef(pathname);
|
||||
const updateSettings = useCallback((next: SiteSettings) => {
|
||||
version.current++;
|
||||
setSettings(next);
|
||||
@@ -51,6 +52,9 @@ export function SiteSettingsProvider({
|
||||
}
|
||||
}, []);
|
||||
useEffect(() => {
|
||||
// SSR already supplied fresh settings for the initial page.
|
||||
if (previousPathname.current === pathname) return;
|
||||
previousPathname.current = pathname;
|
||||
void refresh();
|
||||
}, [pathname, refresh]);
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user