diff --git a/src/lib/components/views/HomeView.svelte b/src/lib/components/views/HomeView.svelte index 6d9cb613f..7a0ffe64a 100644 --- a/src/lib/components/views/HomeView.svelte +++ b/src/lib/components/views/HomeView.svelte @@ -165,14 +165,14 @@ let homeSettings = $state(getSettings()); let isSettingsModalOpen = $state(false); - // Computed greeting with i18n support - const greetingText = $derived.by(() => { + // Computed greeting with i18n support — never call $t() inside $derived() + function getGreetingText(): string { const info = getGreetingInfo(userName); if (info.type === 'custom') { return info.text; } return $t(info.key, { values: { name: info.name } }); - }); + } // Check if a section is visible @@ -905,7 +905,7 @@
{#if homeSettings.greeting.enabled} -

{greetingText}

+

{getGreetingText()}

{:else}
{/if} diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index c9ba25e92..226daaf81 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -10,11 +10,13 @@ // Initialize i18n initI18n(); - // Wait for translations to load - let ready = $derived(!$isLoading); + // Wait for translations to load — avoid store access inside $derived() + function isReady(): boolean { + return !$isLoading; + } -{#if ready} +{#if isReady()} {@render children()} {:else}