From 2dabfb179d11c43f51f410ad4dd28fb473a7ebbb Mon Sep 17 00:00:00 2001 From: Rotimi Best Date: Sat, 28 Mar 2026 11:43:15 +0100 Subject: [PATCH] fix cf build issues --- apps/dashboard/src/routes/+layout.ts | 8 ++++---- packages/ui/src/custom/moving-icons/lesson.svelte | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/dashboard/src/routes/+layout.ts b/apps/dashboard/src/routes/+layout.ts index 081e8e05..d2c0fa50 100644 --- a/apps/dashboard/src/routes/+layout.ts +++ b/apps/dashboard/src/routes/+layout.ts @@ -5,15 +5,15 @@ const SUPPORTED_LANGUAGES = config?.loaders?.map((loader) => loader.locale) || [ export const load = async ({ url, data }) => { const { pathname } = url; - const serverLang = data.serverLang?.split?.('-')?.[0] || 'en'; - const persistedLocale = data.localeCookie || getPersistedLocale(); + const serverLang = data?.serverLang?.split?.('-')?.[0] || 'en'; + const persistedLocale = data?.localeCookie || getPersistedLocale(); - const userLocale = persistedLocale || data.locals?.profile?.locale || getInitialLocale(serverLang); + const userLocale = persistedLocale || data?.locals?.profile?.locale || getInitialLocale(serverLang); const initLocale = getInitialLocale(userLocale); await loadTranslations(initLocale, pathname); // keep this just before the `return` - return data; + return data ?? {}; }; function getInitialLocale(lang: string): string { diff --git a/packages/ui/src/custom/moving-icons/lesson.svelte b/packages/ui/src/custom/moving-icons/lesson.svelte index 7bf36df7..f1929159 100644 --- a/packages/ui/src/custom/moving-icons/lesson.svelte +++ b/packages/ui/src/custom/moving-icons/lesson.svelte @@ -35,14 +35,14 @@ class:animate={isHovered} > - - + + - - + +