From eab209a26b5bc6eb9cf13bc082fd506dea82e10a Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Mon, 6 May 2019 12:00:48 -0600 Subject: [PATCH] Log in to the right homeserver when changing the homeserver --- src/components/structures/auth/Login.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/components/structures/auth/Login.js b/src/components/structures/auth/Login.js index 46bf0c2c76..af9370f2db 100644 --- a/src/components/structures/auth/Login.js +++ b/src/components/structures/auth/Login.js @@ -121,6 +121,14 @@ module.exports = React.createClass({ this._unmounted = true; }, + componentWillReceiveProps(newProps) { + if (newProps.serverConfig.hsUrl === this.props.serverConfig.hsUrl && + newProps.serverConfig.isUrl === this.props.serverConfig.isUrl) return; + + // Ensure that we end up actually logging in to the right place + this._initLoginLogic(newProps.serverConfig.hsUrl, newProps.serverConfig.isUrl); + }, + onPasswordLoginError: function(errorText) { this.setState({ errorText,