From 3075c97baec941039297a2aea7772c668eb381e0 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Fri, 20 Nov 2015 10:27:21 +0000 Subject: [PATCH] Set busy Spinner --- src/components/login/Registration.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/components/login/Registration.js b/src/components/login/Registration.js index f7a9be36f9..8fda406d46 100644 --- a/src/components/login/Registration.js +++ b/src/components/login/Registration.js @@ -94,6 +94,10 @@ module.exports = React.createClass({ onFormSubmit: function(formVals) { var self = this; + this.setState({ + errorText: "", + busy: true + }); this.onProcessingRegistration(this.registerLogic.register(formVals)); }, @@ -122,12 +126,18 @@ module.exports = React.createClass({ identityServerUrl: self.registerLogic.getIdentityServerUrl(), accessToken: response.access_token }); + self.setState({ + busy: false + }); }, function(err) { if (err.message) { self.setState({ errorText: err.message }); } + self.setState({ + busy: false + }); console.log(err); }); }, @@ -158,6 +168,9 @@ module.exports = React.createClass({ this.registerLogic.tellStage("m.login.recaptcha", { divId: divIdName }); + this.setState({ + busy: false // requires user input + }); }, // TODO: @@ -211,11 +224,19 @@ module.exports = React.createClass({ console.error("Unknown register state: %s", currStep); break; } + var busySpinner; + if (this.state.busy) { + var Spinner = sdk.getComponent("atoms.Spinner"); + busySpinner = ( + + ); + } return (

Create an account

{registerStep}
{this.state.errorText}
+ {busySpinner}