From 120123bcb1e5ed1cec8701d3294318e41ff16b48 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 7 Jun 2019 07:27:15 -0600 Subject: [PATCH] Allow submit on forgot password page --- src/components/structures/auth/ForgotPassword.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/structures/auth/ForgotPassword.js b/src/components/structures/auth/ForgotPassword.js index 8f660f9298..62a67c7ec5 100644 --- a/src/components/structures/auth/ForgotPassword.js +++ b/src/components/structures/auth/ForgotPassword.js @@ -82,8 +82,10 @@ module.exports = React.createClass({ serverConfig.isUrl, ); this.setState({serverIsAlive: true}); + return true; } catch (e) { this.setState(AutoDiscoveryUtils.authComponentStateForError(e)); + return false; } }, @@ -117,10 +119,11 @@ module.exports = React.createClass({ }); }, - onSubmitForm: function(ev) { + onSubmitForm: async function(ev) { ev.preventDefault(); - if (!this.state.serverIsAlive) return; + const shouldBlockSubmit = await this._checkServerLiveliness(this.props.serverConfig); + if (shouldBlockSubmit) return; if (!this.state.email) { this.showErrorDialog(_t('The email address linked to your account must be entered.')); @@ -293,7 +296,6 @@ module.exports = React.createClass({ className="mx_Login_submit" type="submit" value={_t('Send Reset Email')} - disabled={!this.state.serverIsAlive} />