diff options
author | enahum <nahumhbl@gmail.com> | 2016-12-05 10:19:12 -0300 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2016-12-05 08:19:12 -0500 |
commit | 145876681f03f68d2fcdd4f0339f6b2b9f7b9958 (patch) | |
tree | a1d46412813338d5e9453e3fc515dd52188cef91 /webapp/components/user_settings/user_settings_modal.jsx | |
parent | 05783664cd91e278913db5504e60bb8bc2992cb6 (diff) | |
download | chat-145876681f03f68d2fcdd4f0339f6b2b9f7b9958.tar.gz chat-145876681f03f68d2fcdd4f0339f6b2b9f7b9958.tar.bz2 chat-145876681f03f68d2fcdd4f0339f6b2b9f7b9958.zip |
Fix react warnings and part of backstage (#4706)
Diffstat (limited to 'webapp/components/user_settings/user_settings_modal.jsx')
-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()) { |