From ec983b838a3a1486cbde2c0733552b3d5ade14de Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 29 Aug 2017 14:07:43 +0100 Subject: [PATCH] Unbreak password reset with a non-default HS Broken by the change from onHsUrlChanged to onServerConfigChanged in https://github.com/matrix-org/matrix-react-sdk/pull/811 where ForgotPassword got missed. --- .../structures/login/ForgotPassword.js | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/components/structures/login/ForgotPassword.js b/src/components/structures/login/ForgotPassword.js index 320d21f5b4..4a03ff155e 100644 --- a/src/components/structures/login/ForgotPassword.js +++ b/src/components/structures/login/ForgotPassword.js @@ -136,16 +136,15 @@ module.exports = React.createClass({ }); }, - onHsUrlChanged: function(newHsUrl) { - this.setState({ - enteredHomeserverUrl: newHsUrl - }); - }, - - onIsUrlChanged: function(newIsUrl) { - this.setState({ - enteredIdentityServerUrl: newIsUrl - }); + onServerConfigChange: function(config) { + const newState = {}; + if (config.hsUrl !== undefined) { + newState.enteredHomeserverUrl = config.hsUrl; + } + if (config.isUrl !== undefined) { + newState.enteredIdentityServerUrl = config.isUrl; + } + this.setState(newState); }, showErrorDialog: function(body, title) { @@ -221,8 +220,7 @@ module.exports = React.createClass({ defaultIsUrl={this.props.defaultIsUrl} customHsUrl={this.props.customHsUrl} customIsUrl={this.props.customIsUrl} - onHsUrlChanged={this.onHsUrlChanged} - onIsUrlChanged={this.onIsUrlChanged} + onServerConfigChange={this.onServerConfigChange} delayTimeMs={0}/>