diff options
author | JoramWilander <jwawilander@gmail.com> | 2015-12-01 11:59:35 -0500 |
---|---|---|
committer | JoramWilander <jwawilander@gmail.com> | 2015-12-01 11:59:35 -0500 |
commit | 362b9f2f940a242b19fe2d4d1b2e896ad12ab092 (patch) | |
tree | 428c4ea513a618e9be62e0def75826f4a00fa674 /web | |
parent | 62c96514bfa243029dba2d9b47b5b8a8322059e4 (diff) | |
download | chat-362b9f2f940a242b19fe2d4d1b2e896ad12ab092.tar.gz chat-362b9f2f940a242b19fe2d4d1b2e896ad12ab092.tar.bz2 chat-362b9f2f940a242b19fe2d4d1b2e896ad12ab092.zip |
Fix channel creation errors
Diffstat (limited to 'web')
-rw-r--r-- | web/react/components/channel_notifications_modal.jsx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/web/react/components/channel_notifications_modal.jsx b/web/react/components/channel_notifications_modal.jsx index 79b769c8a..bae1f13f0 100644 --- a/web/react/components/channel_notifications_modal.jsx +++ b/web/react/components/channel_notifications_modal.jsx @@ -32,11 +32,13 @@ export default class ChannelNotificationsModal extends React.Component { activeSection: '' }; } - componentDidMount() { - ChannelStore.addChangeListener(this.onListenerChange); - } - componentWillUnmount() { - ChannelStore.removeChangeListener(this.onListenerChange); + componentWillReceiveProps(nextProps) { + if (nextProps.show) { + this.onListenerChange(); + ChannelStore.addChangeListener(this.onListenerChange); + } else { + ChannelStore.removeChangeListener(this.onListenerChange); + } } onListenerChange() { const curChannelId = ChannelStore.getCurrentId(); |