diff options
| author | Adam Soltys <[email protected]> | 2022-08-02 10:06:57 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-08-02 10:06:57 -0700 |
| commit | 05f5001fc7d325e31d9c777be11343604c72fbfd (patch) | |
| tree | e6f066b9df653d97d3c0b611cdfbb69e2bcc4098 /src/routes | |
| parent | 63a4af3686b7a81874a87259f6ec5dd44aa97e48 (diff) | |
| download | coinos-ui-05f5001fc7d325e31d9c777be11343604c72fbfd.tar.gz coinos-ui-05f5001fc7d325e31d9c777be11343604c72fbfd.zip | |
catch login and registration errors
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; } |
