From f61e093b53c8e18cd3365b8f0bb03ffadb6422ef Mon Sep 17 00:00:00 2001
From: nickago <ngonella@calpoly.edu>
Date: Fri, 7 Aug 2015 11:21:39 -0700
Subject: Cosmetic refactoring and removing no-op condition of set state

---
 web/react/components/user_settings.jsx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

(limited to 'web/react/components/user_settings.jsx')

diff --git a/web/react/components/user_settings.jsx b/web/react/components/user_settings.jsx
index d0ce23639..ed4f3fd98 100644
--- a/web/react/components/user_settings.jsx
+++ b/web/react/components/user_settings.jsx
@@ -524,12 +524,13 @@ var SecurityTab = React.createClass({
         $(this.getDOMNode()).find('.form-control').each(function() {
             this.value = '';
         });
+        this.setState({current_password: '', new_password: '', confirm_password: '', server_error: null, password_error: null});
 
         if (!this.state.willReturn) {
             this.props.updateTab('general');
+        } else {
+            this.setState({willReturn: false});
         }
-
-        this.setState({current_password: '', new_password: '', confirm_password: '', server_error: null, password_error: null, willReturn: false});
     },
     componentDidMount: function() {
         $('#user_settings1').on('hidden.bs.modal', this.handleClose);
-- 
cgit v1.2.3-1-g7c22

