From 379efb0a33d12b2540440b2a6c540265c542d97c Mon Sep 17 00:00:00 2001
From: David Lu <david.lu97@outlook.com>
Date: Wed, 10 Aug 2016 15:20:44 -0400
Subject: PLT-3846 Fixed loading screen not disappearing upon joining team
 (#3779)

* fixed loading screen not disappearing upon joining team

* Update signup_user_complete.jsx
---
 webapp/components/signup_user_complete.jsx | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

(limited to 'webapp/components/signup_user_complete.jsx')

diff --git a/webapp/components/signup_user_complete.jsx b/webapp/components/signup_user_complete.jsx
index eec143996..4c2668ece 100644
--- a/webapp/components/signup_user_complete.jsx
+++ b/webapp/components/signup_user_complete.jsx
@@ -69,12 +69,12 @@ export default class SignupUserComplete extends React.Component {
         if ((inviteId && inviteId.length > 0) || (hash && hash.length > 0)) {
             // if we are already logged in then attempt to just join the team
             if (UserStore.getCurrentUser()) {
-                loading = true;
                 Client.addUserToTeamFromInvite(
                     data,
                     hash,
                     inviteId,
                     (team) => {
+                        loading = true;
                         GlobalActions.emitInitialLoad(
                             () => {
                                 browserHistory.push('/' + team.name);
@@ -111,14 +111,12 @@ export default class SignupUserComplete extends React.Component {
                             serverError: null,
                             teamDisplayName: inviteData.display_name,
                             teamName: inviteData.name,
-                            teamId: inviteData.id,
-                            loading: false
+                            teamId: inviteData.id
                         });
                     },
                     () => {
                         this.setState({
                             noOpenServerError: true,
-                            loading: false,
                             serverError:
                                 <FormattedMessage
                                     id='signup_user_completed.invalid_invite'
@@ -128,6 +126,7 @@ export default class SignupUserComplete extends React.Component {
                     }
                 );
 
+                loading = false;
                 data = '';
                 hash = '';
             }
@@ -145,8 +144,7 @@ export default class SignupUserComplete extends React.Component {
                     <FormattedMessage
                         id='signup_user_completed.no_open_server'
                         defaultMessage='This server does not allow open signups.  Please speak with your Administrator to receive an invitation.'
-                    />,
-                loading: false
+                    />
             });
         }
 
-- 
cgit v1.2.3-1-g7c22

