diff --git a/src/components/structures/auth/Login.js b/src/components/structures/auth/Login.js index b380d431f9..6d61eac895 100644 --- a/src/components/structures/auth/Login.js +++ b/src/components/structures/auth/Login.js @@ -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) { diff --git a/src/components/views/auth/ServerTypeSelector.js b/src/components/views/auth/ServerTypeSelector.js index 765cc58280..de76e6acf9 100644 --- a/src/components/views/auth/ServerTypeSelector.js +++ b/src/components/views/auth/ServerTypeSelector.js @@ -26,16 +26,16 @@ export const FREE = 'Free'; export const PREMIUM = 'Premium'; export const ADVANCED = 'Advanced'; -const MATRIX_ORG_HS = 'https://matrix.org'; - -const TYPES = [ - { +export const TYPES = { + FREE: { id: FREE, label: () => _t('Free'), logo: () => , description: () => _t('Join millions for free on the largest public server'), + hsUrl: 'https://matrix.org', + isUrl: 'https://vector.im', }, - { + PREMIUM: { id: PREMIUM, label: () => _t('Premium'), logo: () => , @@ -45,7 +45,7 @@ const TYPES = [ , }), }, - { + ADVANCED: { id: ADVANCED, label: () => _t('Advanced'), logo: () =>