Update HS / IS URLs when changing server types

This commit is contained in:
J. Ryan Stinnett 2019-01-25 23:36:18 -06:00
parent 344a5d1547
commit 306380d647
2 changed files with 44 additions and 14 deletions

View file

@ -306,6 +306,28 @@ module.exports = React.createClass({
this.setState({
serverType: type,
});
// When changing server types, set the HS / IS URLs to reasonable defaults for the
// the new type.
switch (type) {
case ServerType.FREE: {
const { hsUrl, isUrl } = ServerType.TYPES.FREE;
this.onServerConfigChange({
hsUrl,
isUrl,
});
break;
}
case ServerType.PREMIUM:
// TODO: Handle the Modular case.
break;
case ServerType.ADVANCED:
this.onServerConfigChange({
hsUrl: this.props.defaultHsUrl,
isUrl: this.props.defaultIsUrl,
});
break;
}
},
onRegisterClick: function(ev) {