1
0
Fork 1
mirror of https://github.com/elk-zone/elk.git synced 2024-11-19 23:40:07 +00:00

fix: missed language code fallback (#1559)

This commit is contained in:
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

View file

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