From 31ab95638e52bdbf747b2f8820a416d14741fef1 Mon Sep 17 00:00:00 2001 From: Thomas Basler Date: Tue, 26 Aug 2025 19:34:02 +0200 Subject: [PATCH] webapp: Make compiler happy --- webapp/src/i18n.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/src/i18n.ts b/webapp/src/i18n.ts index 454e891a..6c878135 100644 --- a/webapp/src/i18n.ts +++ b/webapp/src/i18n.ts @@ -78,7 +78,7 @@ export const i18n = createI18n({ legacy: false, globalInjection: true, locale: navigator.language.split('-')[0], - fallbackLocale: allLocales[0].code, + fallbackLocale: allLocales[0]?.code ?? 'en', messages, datetimeFormats: dateTimeFormats, numberFormats: numberFormats, @@ -101,7 +101,7 @@ export async function setLocale(locale: string) { // fetch() error occurred. if (messages === undefined) { - i18n.global.locale.value = allLocales[0].code; + i18n.global.locale.value = allLocales[0]?.code ?? 'en'; return; }