From 654fdf1c7edf5629a338a737b21b1824fc7a5c97 Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sun, 31 Jan 2021 15:41:33 -0800 Subject: [PATCH] fix: Guard unset language --- app/components/Authenticated.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/Authenticated.js b/app/components/Authenticated.js index cba8b62b5..86b43ef51 100644 --- a/app/components/Authenticated.js +++ b/app/components/Authenticated.js @@ -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("_", "-"));