fix: Guard unset language

This commit is contained in:
Tom Moor
2021-01-31 15:41:33 -08:00
parent 2a5fd0b332
commit 654fdf1c7e

View File

@@ -20,7 +20,7 @@ const Authenticated = ({ children }: Props) => {
// Watching for language changes here as this is the earliest point we have
// the user available and means we can start loading translations faster
React.useEffect(() => {
if (i18n.language !== language) {
if (language && i18n.language !== language) {
// Languages are stored in en_US format in the database, however the
// frontend translation framework (i18next) expects en-US
i18n.changeLanguage(language.replace("_", "-"));