diff options
author | Christopher Speller <crspeller@gmail.com> | 2015-12-01 14:47:19 -0500 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2015-12-01 14:47:19 -0500 |
commit | e99437aa3b9444e8249c0900d9e402c7aa1fdecf (patch) | |
tree | 0d3d5e733d4ec9341cb82a9993ca1872f2e2a702 /web | |
parent | d0b73c02670a2028125c890742aa7f62e5d0986f (diff) | |
parent | 362b9f2f940a242b19fe2d4d1b2e896ad12ab092 (diff) | |
download | chat-e99437aa3b9444e8249c0900d9e402c7aa1fdecf.tar.gz chat-e99437aa3b9444e8249c0900d9e402c7aa1fdecf.tar.bz2 chat-e99437aa3b9444e8249c0900d9e402c7aa1fdecf.zip |
Merge pull request #1560 from mattermost/plt-1270
PLT-1270 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(); |