1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 09:52:26 +01:00

ui - add guard against unset locale

This commit is contained in:
kumavis 2018-03-28 23:11:41 -07:00
parent 86c7c6746d
commit ac4cb3444d

View File

@ -108,11 +108,12 @@ class Settings extends Component {
renderCurrentLocale () { renderCurrentLocale () {
const { updateCurrentLocale, currentLocale } = this.props const { updateCurrentLocale, currentLocale } = this.props
const currentLocaleMeta = locales.find(locale => locale.code === currentLocale) const currentLocaleMeta = locales.find(locale => locale.code === currentLocale)
const currentLocaleName = currentLocaleMeta ? currentLocaleMeta.name || ''
return h('div.settings__content-row', [ return h('div.settings__content-row', [
h('div.settings__content-item', [ h('div.settings__content-item', [
h('span', 'Current Language'), h('span', 'Current Language'),
h('span.settings__content-description', `${currentLocaleMeta.name}`), h('span.settings__content-description', `${currentLocaleName}`),
]), ]),
h('div.settings__content-item', [ h('div.settings__content-item', [
h('div.settings__content-item-col', [ h('div.settings__content-item-col', [