From 0e0bf5e15a4e0a9919a7848de5b5bdd9481650d5 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sat, 29 Nov 2025 19:41:51 -0800 Subject: [PATCH] fix: make Navigation read from reactive authStore use authStore.isAuthenticated instead of static server prop ensures nav updates when auth state changes client-side --- src/lib/components/Navigation.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/components/Navigation.svelte b/src/lib/components/Navigation.svelte index 00c48511..73a944a5 100644 --- a/src/lib/components/Navigation.svelte +++ b/src/lib/components/Navigation.svelte @@ -12,6 +12,7 @@ import type { UserCookie } from '$lib/types/UserCookie' import { getAvatarSrc, getAvatarSrcSet } from '$lib/utils/avatar' import UserSettingsModal from './UserSettingsModal.svelte' + import { authStore } from '$lib/stores/auth.store' // Props from layout data const { @@ -29,7 +30,8 @@ }>() const username = $derived(account?.username ?? '') - const isAuth = $derived(Boolean(isAuthProp)) + // Use reactive authStore instead of static server prop for real-time auth state + const isAuth = $derived($authStore.isAuthenticated) const role = $derived(account?.role ?? null) // Element from UserCookie is already a string like "fire", "water", etc. const userElement = $derived(