return early for undefined i18n messages

could happen when we map over a list of objects to create buttons and one only has an icon
This commit is contained in:
Sean Yesmunt 2020-10-19 23:54:32 -04:00
parent dc6267f757
commit 41dfd8a0f8

View file

@ -79,6 +79,10 @@ function removeContextMetadata(message) {
}
export function __(message, tokens) {
if (!message) {
return '';
}
const language = localStorageAvailable
? window.localStorage.getItem('language') || 'en'
: window.navigator.language.slice(0, 2) || 'en';