From 34990d1c8946008f1a012d1820a18dd3617fa60f Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 13 May 2019 14:17:09 +0100 Subject: [PATCH 1/2] Fix bug where email was not required where it shouldn't have been See comment! Fixes https://github.com/vector-im/riot-web/issues/9681 --- src/components/views/auth/RegistrationForm.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/views/auth/RegistrationForm.js b/src/components/views/auth/RegistrationForm.js index 7c083ea270..bef0b9e019 100644 --- a/src/components/views/auth/RegistrationForm.js +++ b/src/components/views/auth/RegistrationForm.js @@ -1,7 +1,7 @@ /* Copyright 2015, 2016 OpenMarket Ltd Copyright 2017 Vector Creations Ltd -Copyright 2018 New Vector Ltd +Copyright 2018, 2019 New Vector Ltd Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -150,7 +150,11 @@ module.exports = React.createClass({ if (!field) { continue; } - field.validate({ allowEmpty: false }); + // We must wait for these validations to finish before queueing + // up the setState below so our setState gies in the queue after + // all the setStates from these validate calls (that's how we + // know they've finished). + await field.validate({ allowEmpty: false }); } // Validation and state updates are async, so we need to wait for them to complete From 59cefbaa442377a59f53ea8f401de5709decde43 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 13 May 2019 14:24:56 +0100 Subject: [PATCH 2/2] Typo Co-Authored-By: J. Ryan Stinnett --- src/components/views/auth/RegistrationForm.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/auth/RegistrationForm.js b/src/components/views/auth/RegistrationForm.js index bef0b9e019..654387e196 100644 --- a/src/components/views/auth/RegistrationForm.js +++ b/src/components/views/auth/RegistrationForm.js @@ -151,7 +151,7 @@ module.exports = React.createClass({ continue; } // We must wait for these validations to finish before queueing - // up the setState below so our setState gies in the queue after + // up the setState below so our setState goes in the queue after // all the setStates from these validate calls (that's how we // know they've finished). await field.validate({ allowEmpty: false });