From 5432b0947853caef98520da59be668be5ef0f230 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Tue, 5 Feb 2019 05:25:13 +0000 Subject: [PATCH] Default to registration phase when custom URLs disabled --- src/components/structures/auth/Login.js | 1 - src/components/structures/auth/Registration.js | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/structures/auth/Login.js b/src/components/structures/auth/Login.js index a98e77c12b..17da4a855f 100644 --- a/src/components/structures/auth/Login.js +++ b/src/components/structures/auth/Login.js @@ -560,7 +560,6 @@ module.exports = React.createClass({ const ModularServerConfig = sdk.getComponent("auth.ModularServerConfig"); const AccessibleButton = sdk.getComponent("elements.AccessibleButton"); - // TODO: May need to adjust the behavior of this config option if (SdkConfig.get()['disable_custom_urls']) { return null; } diff --git a/src/components/structures/auth/Registration.js b/src/components/structures/auth/Registration.js index c0b393febf..55cb4b7499 100644 --- a/src/components/structures/auth/Registration.js +++ b/src/components/structures/auth/Registration.js @@ -69,6 +69,8 @@ module.exports = React.createClass({ }, getInitialState: function() { + const customURLsAllowed = !SdkConfig.get()['disable_custom_urls']; + return { busy: false, errorText: null, @@ -90,6 +92,8 @@ module.exports = React.createClass({ serverType: null, hsUrl: this.props.customHsUrl, isUrl: this.props.customIsUrl, + // Phase of the overall registration dialog. + phase: customURLsAllowed ? PHASE_SERVER_DETAILS : PHASE_REGISTRATION, flows: null, }; }, @@ -367,7 +371,6 @@ module.exports = React.createClass({ const ModularServerConfig = sdk.getComponent("auth.ModularServerConfig"); const AccessibleButton = sdk.getComponent("elements.AccessibleButton"); - // TODO: May need to adjust the behavior of this config option if (SdkConfig.get()['disable_custom_urls']) { return null; }