Patch bad migration, sanitize bad value (#2179)

This commit is contained in:
Eric Bailey 2023-12-11 17:34:18 -06:00 committed by GitHub
parent 3592f6f50b
commit bae63f9bf0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 3 deletions

View file

@ -2,6 +2,7 @@ import {useEffect} from 'react'
import {i18n} from '@lingui/core'
import {useLanguagePrefs} from '#/state/preferences'
import {sanitizeAppLanguageSetting} from '#/locale/helpers'
export const locales = {
en: 'English',
@ -29,6 +30,6 @@ export async function dynamicActivate(locale: string) {
export async function useLocaleLanguage() {
const {appLanguage} = useLanguagePrefs()
useEffect(() => {
dynamicActivate(appLanguage)
dynamicActivate(sanitizeAppLanguageSetting(appLanguage))
}, [appLanguage])
}