diff --git a/src/components/structures/login/ForgotPassword.js b/src/components/structures/login/ForgotPassword.js index bbee4c3207..7e0cd5da8e 100644 --- a/src/components/structures/login/ForgotPassword.js +++ b/src/components/structures/login/ForgotPassword.js @@ -24,7 +24,6 @@ import MatrixClientPeg from "../../../MatrixClientPeg"; import SdkConfig from "../../../SdkConfig"; import PasswordReset from "../../../PasswordReset"; -import makeLanguageSelector from "./LanguageSelector"; module.exports = React.createClass({ displayName: 'ForgotPassword', @@ -202,6 +201,8 @@ module.exports = React.createClass({ ); } + const LanguageSelector = sdk.getComponent('structures.login.LanguageSelector'); + resetPasswordJsx = (
@@ -236,7 +237,7 @@ module.exports = React.createClass({ { _t('Create an account') } - { makeLanguageSelector() } +
diff --git a/src/components/structures/login/LanguageSelector.js b/src/components/structures/login/LanguageSelector.js index 1e576bdbb8..965d8334d9 100644 --- a/src/components/structures/login/LanguageSelector.js +++ b/src/components/structures/login/LanguageSelector.js @@ -28,7 +28,7 @@ function onChange(newLang) { } } -export default function makeLanguageSelector() { +export default function LanguageSelector() { if (SdkConfig.get()['disable_login_language_selector']) return
; const LanguageDropdown = sdk.getComponent('views.elements.LanguageDropdown'); diff --git a/src/components/structures/login/Login.js b/src/components/structures/login/Login.js index c4a5b8ba57..bc04434bb2 100644 --- a/src/components/structures/login/Login.js +++ b/src/components/structures/login/Login.js @@ -25,7 +25,6 @@ import sdk from '../../../index'; import Login from '../../../Login'; import SdkConfig from '../../../SdkConfig'; import SettingsStore from "../../../settings/SettingsStore"; -import makeLanguageSelector from "./LanguageSelector"; // For validating phone numbers without country codes const PHONE_NUMBER_REGEX = /^[0-9()\-\s]*$/; @@ -427,6 +426,8 @@ module.exports = React.createClass({ ); } + const LanguageSelector = sdk.getComponent('structures.login.LanguageSelector'); + return (
@@ -440,7 +441,7 @@ module.exports = React.createClass({ { _t('Create an account') } { loginAsGuestJsx } - { makeLanguageSelector() } +
diff --git a/src/components/structures/login/Registration.js b/src/components/structures/login/Registration.js index 409234e2ed..462063406f 100644 --- a/src/components/structures/login/Registration.js +++ b/src/components/structures/login/Registration.js @@ -29,7 +29,6 @@ import RtsClient from '../../../RtsClient'; import { _t } from '../../../languageHandler'; import SdkConfig from '../../../SdkConfig'; import SettingsStore from "../../../settings/SettingsStore"; -import makeLanguageSelector from "./LanguageSelector"; const MIN_PASSWORD_LENGTH = 6; @@ -413,6 +412,8 @@ module.exports = React.createClass({ ); } + const LanguageSelector = sdk.getComponent('structures.login.LanguageSelector'); + return (
@@ -426,7 +427,7 @@ module.exports = React.createClass({ { registerBody } { signIn } { errorText } - { makeLanguageSelector() } +