Fix imports
parent
9bce417400
commit
cc0924f1c7
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue