diff --git a/src/routes/__layout.svelte b/src/routes/__layout.svelte index bae275346e..ff4976ffd5 100644 --- a/src/routes/__layout.svelte +++ b/src/routes/__layout.svelte @@ -7,10 +7,13 @@ import { page } from '$app/stores'; import { user } from '$lib/stores/user'; import { onMount } from 'svelte'; - import Notifications from '$lib/layout/notifications.svelte'; import { base } from '$app/paths'; import { browser } from '$app/env'; import { app } from '$lib/stores/app'; + import Notifications from '$lib/layout/notifications.svelte'; + import Loading from './_loading.svelte'; + + let loaded = false; if (browser) { window.GOOGLE_ANALYTICS = import.meta.env.VITE_GOOGLE_ANALYTICS?.toString() ?? false; @@ -27,6 +30,8 @@ } } catch (error) { await goto(`${base}/login`); + } finally { + loaded = true; } }); @@ -67,4 +72,8 @@ - +{#if loaded} + +{:else} + +{/if} diff --git a/src/routes/_loading.svelte b/src/routes/_loading.svelte new file mode 100644 index 0000000000..50c1b1526b --- /dev/null +++ b/src/routes/_loading.svelte @@ -0,0 +1,74 @@ + + +
+
+
+
+
+
+
+ Appwrite Light Logo +
+ +