From 6209d62f49c0261fc183ebd7945a6e8df8291960 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 18 Sep 2019 13:16:21 +0100 Subject: [PATCH 1/3] Don't show spinner if registration is disabled Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/structures/auth/Registration.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/structures/auth/Registration.js b/src/components/structures/auth/Registration.js index 7af1eaae34..6321028457 100644 --- a/src/components/structures/auth/Registration.js +++ b/src/components/structures/auth/Registration.js @@ -238,11 +238,15 @@ module.exports = createReactClass({ } else if (e.httpStatus === 403 && e.errcode === "M_UNKNOWN") { this.setState({ errorText: _t("Registration has been disabled on this homeserver."), + // add empty flows array to get rid of spinner + flows: [], }); } else { console.log("Unable to query for supported registration methods.", e); this.setState({ errorText: _t("Unable to query for supported registration methods."), + // add empty flows array to get rid of spinner + flows: [], }); } } @@ -542,7 +546,7 @@ module.exports = createReactClass({ return
; - } else { + } else if (this.state.flows.length) { let onEditServerDetailsClick = null; // If custom URLs are allowed and we haven't selected the Free server type, wire // up the server details edit link. From 02dfdffc4f7e2ef9e4485e67d5990c27f12071f7 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Wed, 18 Sep 2019 14:35:13 +0100 Subject: [PATCH 2/3] Fix failing test due to newly added assumption Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- test/components/structures/auth/Registration-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/components/structures/auth/Registration-test.js b/test/components/structures/auth/Registration-test.js index 38188b2536..4fed63d370 100644 --- a/test/components/structures/auth/Registration-test.js +++ b/test/components/structures/auth/Registration-test.js @@ -71,7 +71,7 @@ describe('Registration', function() { // Set non-empty flows & matrixClient to get past the loading spinner root.setState({ - flows: [], + flows: [{}], matrixClient: {}, busy: false, }); From d5c96b86d425a4f9aec248b2c90eed1ea0cfda50 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 19 Sep 2019 10:31:34 +0100 Subject: [PATCH 3/3] fix test Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- test/components/structures/auth/Registration-test.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/components/structures/auth/Registration-test.js b/test/components/structures/auth/Registration-test.js index 4fed63d370..9c125adacc 100644 --- a/test/components/structures/auth/Registration-test.js +++ b/test/components/structures/auth/Registration-test.js @@ -71,7 +71,9 @@ describe('Registration', function() { // Set non-empty flows & matrixClient to get past the loading spinner root.setState({ - flows: [{}], + flows: [{ + stages: [], + }], matrixClient: {}, busy: false, });