Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 8729442

Browse files
authored
Merge pull request #2961 from matrix-org/dbkr/optional_email_was_not_optional
Fix bug where email was not required where it shouldn't have been
2 parents 86ae9d9 + 59cefba commit 8729442

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/components/views/auth/RegistrationForm.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
Copyright 2015, 2016 OpenMarket Ltd
33
Copyright 2017 Vector Creations Ltd
4-
Copyright 2018 New Vector Ltd
4+
Copyright 2018, 2019 New Vector Ltd
55
66
Licensed under the Apache License, Version 2.0 (the "License");
77
you may not use this file except in compliance with the License.
@@ -150,7 +150,11 @@ module.exports = React.createClass({
150150
if (!field) {
151151
continue;
152152
}
153-
field.validate({ allowEmpty: false });
153+
// We must wait for these validations to finish before queueing
154+
// up the setState below so our setState goes in the queue after
155+
// all the setStates from these validate calls (that's how we
156+
// know they've finished).
157+
await field.validate({ allowEmpty: false });
154158
}
155159

156160
// Validation and state updates are async, so we need to wait for them to complete

0 commit comments

Comments
 (0)