From cc0924f1c7afbe7713efe6829c7e9da5005f41fd Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 23 May 2017 18:16:02 +0100 Subject: [PATCH] Fix imports --- src/components/views/elements/LanguageDropdown.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/views/elements/LanguageDropdown.js b/src/components/views/elements/LanguageDropdown.js index 0da05ff07e..4feec57df8 100644 --- a/src/components/views/elements/LanguageDropdown.js +++ b/src/components/views/elements/LanguageDropdown.js @@ -18,10 +18,9 @@ import React from 'react'; import sdk from '../../../index'; import UserSettingsStore from '../../../UserSettingsStore'; -const _localSettings = UserSettingsStore.getLocalSettings(); import _t from 'counterpart-riot'; -const languageHandler = require('../../../languageHandler'); -var SdkConfig = require("../../../SdkConfig"); +import languageHandler from '../../../languageHandler'; +import SdkConfig from '../../../SdkConfig'; let LANGUAGES = []; @@ -44,7 +43,6 @@ export default class LanguageDropdown extends React.Component { } componentWillMount() { - const languageKeys = SdkConfig.get().languages; // Build const LANGUAGES in a way that counterpart allows translation inside object: @@ -71,6 +69,7 @@ export default class LanguageDropdown extends React.Component { // If no value is given, we start with the first // country selected, but our parent component // doesn't know this, therefore we do this. + const _localSettings = UserSettingsStore.getLocalSettings(); if (_localSettings.hasOwnProperty('language')) { this.props.onOptionChange(_localSettings.language); }else { @@ -117,6 +116,7 @@ export default class LanguageDropdown extends React.Component { // default value here too, otherwise we need to handle null / undefined // values between mounting and the initial value propgating let value = null; + const _localSettings = UserSettingsStore.getLocalSettings(); if (_localSettings.hasOwnProperty('language')) { value = this.props.value || _localSettings.language; } else {