diff options
Diffstat (limited to 'webapp/components/user_settings')
-rw-r--r-- | webapp/components/user_settings/user_settings_modal.jsx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/webapp/components/user_settings/user_settings_modal.jsx b/webapp/components/user_settings/user_settings_modal.jsx index c1194ed78..e05f61ea7 100644 --- a/webapp/components/user_settings/user_settings_modal.jsx +++ b/webapp/components/user_settings/user_settings_modal.jsx @@ -77,16 +77,24 @@ class UserSettingsModal extends React.Component { }; this.requireConfirm = false; + this.mounted = false; } onUserChanged() { - this.setState({currentUser: UserStore.getCurrentUser()}); + if (this.mounted) { + this.setState({currentUser: UserStore.getCurrentUser()}); + } } componentDidMount() { + this.mounted = true; UserStore.addChangeListener(this.onUserChanged); } + componentWillUnmount() { + this.mounted = false; + } + componentDidUpdate() { UserStore.removeChangeListener(this.onUserChanged); if (!Utils.isMobile()) { |