Fix imports

This commit is contained in:
David Baker 2017-05-23 18:16:02 +01:00
parent 9bce417400
commit cc0924f1c7

View file

@ -18,10 +18,9 @@ import React from 'react';
import sdk from '../../../index'; import sdk from '../../../index';
import UserSettingsStore from '../../../UserSettingsStore'; import UserSettingsStore from '../../../UserSettingsStore';
const _localSettings = UserSettingsStore.getLocalSettings();
import _t from 'counterpart-riot'; import _t from 'counterpart-riot';
const languageHandler = require('../../../languageHandler'); import languageHandler from '../../../languageHandler';
var SdkConfig = require("../../../SdkConfig"); import SdkConfig from '../../../SdkConfig';
let LANGUAGES = []; let LANGUAGES = [];
@ -44,7 +43,6 @@ export default class LanguageDropdown extends React.Component {
} }
componentWillMount() { componentWillMount() {
const languageKeys = SdkConfig.get().languages; const languageKeys = SdkConfig.get().languages;
// Build const LANGUAGES in a way that counterpart allows translation inside object: // 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 // If no value is given, we start with the first
// country selected, but our parent component // country selected, but our parent component
// doesn't know this, therefore we do this. // doesn't know this, therefore we do this.
const _localSettings = UserSettingsStore.getLocalSettings();
if (_localSettings.hasOwnProperty('language')) { if (_localSettings.hasOwnProperty('language')) {
this.props.onOptionChange(_localSettings.language); this.props.onOptionChange(_localSettings.language);
}else { }else {
@ -117,6 +116,7 @@ export default class LanguageDropdown extends React.Component {
// default value here too, otherwise we need to handle null / undefined // default value here too, otherwise we need to handle null / undefined
// values between mounting and the initial value propgating // values between mounting and the initial value propgating
let value = null; let value = null;
const _localSettings = UserSettingsStore.getLocalSettings();
if (_localSettings.hasOwnProperty('language')) { if (_localSettings.hasOwnProperty('language')) {
value = this.props.value || _localSettings.language; value = this.props.value || _localSettings.language;
} else { } else {