diff options
author | Corey Hulen <corey@hulen.com> | 2015-11-24 14:21:44 -0800 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2015-11-24 14:21:44 -0800 |
commit | f239b2c7f26b9577d5837618515cd3d2204a3315 (patch) | |
tree | 70ccdc0f8ad5eb03c5530d16d345228f4cebdfdb /web/react/components | |
parent | bfef7c0563e4e23686a0e7c1e83c9b537b33efc7 (diff) | |
parent | f76f20b25603894bca7ffa9b49e8358291a2e3ff (diff) | |
download | chat-f239b2c7f26b9577d5837618515cd3d2204a3315.tar.gz chat-f239b2c7f26b9577d5837618515cd3d2204a3315.tar.bz2 chat-f239b2c7f26b9577d5837618515cd3d2204a3315.zip |
Merge pull request #1514 from rgarmsen2295/plt-1271
PLT-1271 Fixed issue with changing a channel's notification settings
Diffstat (limited to 'web/react/components')
-rw-r--r-- | web/react/components/channel_notifications_modal.jsx | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/web/react/components/channel_notifications_modal.jsx b/web/react/components/channel_notifications_modal.jsx index 4af95c88f..79b769c8a 100644 --- a/web/react/components/channel_notifications_modal.jsx +++ b/web/react/components/channel_notifications_modal.jsx @@ -28,7 +28,7 @@ export default class ChannelNotificationsModal extends React.Component { this.state = { notifyLevel: member.notify_props.desktop, markUnreadLevel: member.notify_props.mark_unread, - channelId: '', + channelId: ChannelStore.getCurrentId(), activeSection: '' }; } @@ -39,18 +39,21 @@ export default class ChannelNotificationsModal extends React.Component { ChannelStore.removeChangeListener(this.onListenerChange); } onListenerChange() { - if (!this.state.channelId) { + const curChannelId = ChannelStore.getCurrentId(); + + if (!curChannelId) { return; } - const member = ChannelStore.getMember(this.state.channelId); + const newState = {channelId: curChannelId}; + const member = ChannelStore.getMember(curChannelId); if (member.notify_props.desktop !== this.state.notifyLevel || member.notify_props.mark_unread !== this.state.mark_unread) { - this.setState({ - notifyLevel: member.notify_props.desktop, - markUnreadLevel: member.notify_props.mark_unread - }); + newState.notifyLevel = member.notify_props.desktop; + newState.markUnreadLevel = member.notify_props.mark_unread; } + + this.setState(newState); } updateSection(section) { this.setState({activeSection: section}); |