fix: missed language code fallback (#1559)

zio/stable
Svyatoslav Kryukov 2023-02-02 13:36:35 +03:00 committed by GitHub
parent a025b3b434
commit cf76ba3114
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -9,7 +9,7 @@ export default defineNuxtPlugin(async (nuxt) => {
const supportLanguages = (locales as LocaleObject[]).map(locale => locale.code) const supportLanguages = (locales as LocaleObject[]).map(locale => locale.code)
if (!supportLanguages.includes(lang)) if (!supportLanguages.includes(lang))
userSettings.value.language = getDefaultLanguage(locales as string[]) userSettings.value.language = getDefaultLanguage(supportLanguages)
watch([$$(lang), isHydrated], () => { watch([$$(lang), isHydrated], () => {
if (isHydrated.value && lang !== i18n.locale) if (isHydrated.value && lang !== i18n.locale)