diff --git a/web/react/components/user_settings_general.jsx b/web/react/components/user_settings_general.jsx index 10fec29335..5e7bbcb516 100644 --- a/web/react/components/user_settings_general.jsx +++ b/web/react/components/user_settings_general.jsx @@ -163,7 +163,7 @@ module.exports = React.createClass({ } }, updateSection: function(section) { - this.setState({clientError: ''}); + this.setState(assign({}, this.getInitialState(), {clientError: ''})); this.submitActive = false; this.props.updateSection(section); }, diff --git a/web/react/components/user_settings_notifications.jsx b/web/react/components/user_settings_notifications.jsx index 08f6935a15..799e4d65e2 100644 --- a/web/react/components/user_settings_notifications.jsx +++ b/web/react/components/user_settings_notifications.jsx @@ -100,6 +100,10 @@ module.exports = React.createClass({ this.props.updateTab('general'); }, + updateSection: function(section) { + this.setState(this.getInitialState()); + this.props.updateSection(section); + }, componentDidMount: function() { UserStore.addChangeListener(this._onChange); $('#user_settings').on('hidden.bs.modal', this.handleClose); @@ -209,7 +213,7 @@ module.exports = React.createClass({ inputs={inputs} submit={this.handleSubmit} server_error={server_error} - updateSection={function(e){self.props.updateSection("");e.preventDefault();}} + updateSection={function(e){self.updateSection("");e.preventDefault();}} /> ); } else { @@ -226,7 +230,7 @@ module.exports = React.createClass({ ); } @@ -257,7 +261,7 @@ module.exports = React.createClass({ inputs={inputs} submit={this.handleSubmit} server_error={server_error} - updateSection={function(e){self.props.updateSection("");e.preventDefault();}} + updateSection={function(e){self.updateSection("");e.preventDefault();}} /> ); } else { @@ -274,7 +278,7 @@ module.exports = React.createClass({ ); @@ -307,7 +311,7 @@ module.exports = React.createClass({ inputs={inputs} submit={this.handleSubmit} server_error={server_error} - updateSection={function(e){self.props.updateSection("");e.preventDefault();}} + updateSection={function(e){self.updateSection("");e.preventDefault();}} /> ); } else { @@ -322,7 +326,7 @@ module.exports = React.createClass({ ); } @@ -400,7 +404,7 @@ module.exports = React.createClass({ inputs={inputs} submit={this.handleSubmit} server_error={server_error} - updateSection={function(e){self.props.updateSection("");e.preventDefault();}} + updateSection={function(e){self.updateSection("");e.preventDefault();}} /> ); } else { @@ -427,7 +431,7 @@ module.exports = React.createClass({ ); }