From aba329cab5b80b79a9d3240143ec9bf61f750f8f Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 6 Jun 2019 19:41:57 +0100 Subject: [PATCH] Look busy whilst requesting the email token We need to wait for it to finish before letting the user start completing the steps since if it fails, we can't complete the auth. --- src/components/structures/InteractiveAuth.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/components/structures/InteractiveAuth.js b/src/components/structures/InteractiveAuth.js index c893057022..908d7b12bb 100644 --- a/src/components/structures/InteractiveAuth.js +++ b/src/components/structures/InteractiveAuth.js @@ -97,7 +97,7 @@ export default React.createClass({ sessionId: this.props.sessionId, clientSecret: this.props.clientSecret, emailSid: this.props.emailSid, - requestEmailToken: this.props.requestEmailToken, + requestEmailToken: this._requestEmailToken, }); this._authLogic.attemptAuth().then((result) => { @@ -135,6 +135,19 @@ export default React.createClass({ } }, + _requestEmailToken: async function(...args) { + this.setState({ + busy: true, + }); + try { + return await this.props.requestEmailToken(...args); + } finally { + this.setState({ + busy: false, + }); + } + }, + tryContinue: function() { if (this.refs.stageComponent && this.refs.stageComponent.tryContinue) { this.refs.stageComponent.tryContinue();