diff --git a/apps/clock/apps/web/src/routes/(app)/+layout.svelte b/apps/clock/apps/web/src/routes/(app)/+layout.svelte index 63b32a2c0..6bd2fce33 100644 --- a/apps/clock/apps/web/src/routes/(app)/+layout.svelte +++ b/apps/clock/apps/web/src/routes/(app)/+layout.svelte @@ -38,6 +38,9 @@ let { children } = $props(); + // Auth gate - prevent children from mounting before auth is confirmed + let appReady = $state(false); + // CommandBar state let commandBarOpen = $state(false); @@ -262,66 +265,75 @@ if (currentPath === '/' && userSettings.startPage && userSettings.startPage !== '/') { goto(userSettings.startPage, { replaceState: true }); } + + // Auth confirmed - allow children to render + appReady = true; }); -
- +{#if !appReady} +
+
+
+{:else} +
+ -
-
- {@render children()} -
-
+
+
+ {@render children()} +
+
- - (commandBarOpen = false)} - onSearch={handleCommandBarSearch} - onSelect={handleCommandBarSelect} - quickActions={commandBarQuickActions} - placeholder="Schnellzugriff..." - emptyText="Keine Ergebnisse" - searchingText="Suche..." - /> + + (commandBarOpen = false)} + onSearch={handleCommandBarSearch} + onSelect={handleCommandBarSelect} + quickActions={commandBarQuickActions} + placeholder="Schnellzugriff..." + emptyText="Keine Ergebnisse" + searchingText="Suche..." + /> - - {#if clockOnboarding.shouldShow} - - {/if} -
+ + {#if clockOnboarding.shouldShow} + + {/if} +
+{/if}