diff options
| author | Adrien Hopkins <[email protected]> | 2022-08-08 07:42:39 -0500 |
|---|---|---|
| committer | Adrien Hopkins <[email protected]> | 2022-08-08 07:42:39 -0500 |
| commit | b95a816f7b6b31087057efab1081194db75886be (patch) | |
| tree | 48de265def768f24f402b23af0b1779f8f234db2 /src/routes/__layout.svelte | |
| parent | c287bc29267d41f65c9e29efe9bafddfdc64b28e (diff) | |
| parent | f4c85698d32ab1346dcdb75b4244d615a2178e40 (diff) | |
| download | coinos-ui-b95a816f7b6b31087057efab1081194db75886be.tar.gz coinos-ui-b95a816f7b6b31087057efab1081194db75886be.zip | |
Merge branch 'master' into i18n
Diffstat (limited to 'src/routes/__layout.svelte')
| -rw-r--r-- | src/routes/__layout.svelte | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/routes/__layout.svelte b/src/routes/__layout.svelte index 9ec36c57..158397c5 100644 --- a/src/routes/__layout.svelte +++ b/src/routes/__layout.svelte @@ -1,6 +1,5 @@ <script> import { SvelteToast } from '@zerodevx/svelte-toast'; - import { toast } from '@zerodevx/svelte-toast'; import '../app.css'; import '$lib/i18n'; import { onMount } from 'svelte'; @@ -10,16 +9,17 @@ import { browser } from '$app/env'; import { goto } from '$app/navigation'; import { LoadingSplash } from '$comp'; - import { protectedRoutes } from '$lib/utils'; + import { warning, protectedRoutes } from '$lib/utils'; browser && ($token ||= $session.token); + let ready = false; onMount(() => { if (protectedRoutes.find((p) => $page.url.pathname.match(p))) { if (!$token) { goto('/login'); - toast.push('Please sign in to continue.'); + warning('Please sign in to continue.'); } user.subscribe((u) => u?.username && (ready = true)); } else { @@ -43,5 +43,6 @@ --toastContainerRight: auto; --toastContainerBottom: 8rem; --toastContainerLeft: calc(50vw - 8rem); + --toastBackground: #292929; } </style> |
