Skip to content

Commit

Permalink
Ensure matrix.org defaults us to FREE
Browse files Browse the repository at this point in the history
  • Loading branch information
turt2live committed May 3, 2019
1 parent ba9b54a commit d9e5ed2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/components/structures/auth/Registration.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,18 @@ module.exports = React.createClass({
if (newProps.serverConfig.hsUrl === this.props.serverConfig.hsUrl &&
newProps.serverConfig.isUrl === this.props.serverConfig.isUrl) return;

const serverType = ServerType.getTypeFromServerConfig(newProps.serverConfig);
this._replaceClient(newProps.serverConfig);

// Handle cases where the user enters "https://matrix.org" for their server
// from the advanced option - we should default to FREE at that point.
if (serverType !== this.state.serverType) {
// Reset the phase to default phase for the server type.
this.setState({
serverType,
phase: this.getDefaultPhaseForServerType(serverType),
});
}
},

getDefaultPhaseForServerType(type) {
Expand Down

0 comments on commit d9e5ed2

Please sign in to comment.