Changed notification preference submission to only be updated when options have actually changed

This commit is contained in:
hmhealey
2015-09-23 16:58:50 -04:00
parent 284a660a47
commit 111fbb2495

View File

@@ -81,6 +81,11 @@ export default class ChannelNotifications extends React.Component {
var channelId = this.state.channelId;
var notifyLevel = this.state.notifyLevel;
if (ChannelStore.getMember(channelId).notify_level === notifyLevel) {
this.updateSection('');
return;
}
var data = {};
data.channel_id = channelId;
data.user_id = UserStore.getCurrentId();
@@ -244,6 +249,11 @@ export default class ChannelNotifications extends React.Component {
const channelId = this.state.channelId;
const markUnreadLevel = this.state.markUnreadLevel;
if (ChannelStore.getMember(channelId).mark_unread_level === markUnreadLevel) {
this.updateSection('');
return;
}
const data = {
channel_id: channelId,
user_id: UserStore.getCurrentId(),