diff options
Diffstat (limited to 'src/routes')
| -rw-r--r-- | src/routes/__layout.svelte | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/routes/__layout.svelte b/src/routes/__layout.svelte index 406c29e2..ef4ba1d4 100644 --- a/src/routes/__layout.svelte +++ b/src/routes/__layout.svelte @@ -9,9 +9,9 @@ import { browser } from '$app/env'; import { goto } from '$app/navigation'; import { LoadingSplash } from '$comp'; + import { protectedRoutes } from '$lib/utils'; browser && ($token ||= $session.token); - let protectedRoutes = [/receive/, /customers/, /dashboard/, /settings/, /transactions/]; let ready = false; onMount(() => { @@ -20,7 +20,7 @@ goto('/login'); toast.push('Please sign in to continue.'); } - user.subscribe((u) => (ready = true)); + user.subscribe((u) => u?.username && (ready = true)); } else { ready = true; } |
