aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-08-02 10:06:57 -0700
committerAdam Soltys <[email protected]>2022-08-02 10:06:57 -0700
commit0676ad3f9afa2036dccce7165478ea0ba09dae1d (patch)
treeb3bf305befd7afb214af4890326b03ebeea1ebae /src/routes
parentc47a1a57c11e1a23ab00e382d79383360263ba62 (diff)
downloadcoinos-ui-0676ad3f9afa2036dccce7165478ea0ba09dae1d.tar.gz
coinos-ui-0676ad3f9afa2036dccce7165478ea0ba09dae1d.zip
catch login and registration errors
Diffstat (limited to 'src/routes')
-rw-r--r--src/routes/__layout.svelte4
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;
}