Merge pull request #834 from matrix-org/dbkr/fix_registration_custom_server

Fix specifying custom server for registration
pull/21833/head
Luke Barnard 2017-04-26 10:41:29 +01:00 committed by GitHub
commit 5cbf77b53e
1 changed files with 11 additions and 13 deletions

View File

@ -123,18 +123,17 @@ module.exports = React.createClass({
} }
}, },
onHsUrlChanged: function(newHsUrl) { onServerConfigChange: function(config) {
this.setState({ let newState = {};
hsUrl: newHsUrl, if (config.hsUrl !== undefined) {
}); newState.hsUrl = config.hsUrl;
}
if (config.isUrl !== undefined) {
newState.isUrl = config.isUrl;
}
this.setState(newState, function() {
this._replaceClient(); this._replaceClient();
},
onIsUrlChanged: function(newIsUrl) {
this.setState({
isUrl: newIsUrl,
}); });
this._replaceClient();
}, },
_replaceClient: function() { _replaceClient: function() {
@ -390,8 +389,7 @@ module.exports = React.createClass({
customIsUrl={this.props.customIsUrl} customIsUrl={this.props.customIsUrl}
defaultHsUrl={this.props.defaultHsUrl} defaultHsUrl={this.props.defaultHsUrl}
defaultIsUrl={this.props.defaultIsUrl} defaultIsUrl={this.props.defaultIsUrl}
onHsUrlChanged={this.onHsUrlChanged} onServerConfigChange={this.onServerConfigChange}
onIsUrlChanged={this.onIsUrlChanged}
delayTimeMs={1000} delayTimeMs={1000}
/> />
</div> </div>