summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReed Garmsen <rgarmsen2295@gmail.com>2015-11-24 09:46:51 -0800
committerReed Garmsen <rgarmsen2295@gmail.com>2015-11-24 10:46:50 -0800
commitf76f20b25603894bca7ffa9b49e8358291a2e3ff (patch)
treee555b45556692559bede25b845c55cd1062b89ef
parentda194941b69614d7e86755fc8e21e3241b1c1973 (diff)
downloadchat-f76f20b25603894bca7ffa9b49e8358291a2e3ff.tar.gz
chat-f76f20b25603894bca7ffa9b49e8358291a2e3ff.tar.bz2
chat-f76f20b25603894bca7ffa9b49e8358291a2e3ff.zip
Fixed regression with setting channel notification settings
-rw-r--r--web/react/components/channel_notifications_modal.jsx17
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});