fix: broken states.

This commit is contained in:
Darshan
2025-04-05 15:07:22 +05:30
parent f6f20aa97a
commit ee3e615ab7

View File

@@ -50,8 +50,8 @@
import '$icons/output/web-icon.css';
import { browser, dev } from '$app/environment';
import { page, updated } from '$app/state';
import { navigating } from '$app/stores';
import { page } from '$app/state';
import { navigating, updated } from '$app/stores';
import { onMount } from 'svelte';
import { loggedIn } from '$lib/utils/console';
import { beforeNavigate } from '$app/navigation';
@@ -96,7 +96,9 @@
if (window) {
tracked.clear();
}
if (updated && !willUnload && to?.url) {
// TODO: thejessewinton, the `updated` from `svelte/state` creates an infinite refresh loop on docs references pages!
if ($updated && !willUnload && to?.url) {
location.href = to.url.href;
}
});