summaryrefslogtreecommitdiffstats
path: root/webapp/stores/channel_store.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/stores/channel_store.jsx')
-rw-r--r--webapp/stores/channel_store.jsx9
1 files changed, 9 insertions, 0 deletions
diff --git a/webapp/stores/channel_store.jsx b/webapp/stores/channel_store.jsx
index 9437d5e44..32ea8441c 100644
--- a/webapp/stores/channel_store.jsx
+++ b/webapp/stores/channel_store.jsx
@@ -288,6 +288,14 @@ class ChannelStoreClass extends EventEmitter {
getUnreadCounts() {
return this.unreadCounts;
}
+
+ leaveChannel(id) {
+ delete this.channelMembers[id];
+ const element = this.channels.indexOf(id);
+ if (element > -1) {
+ this.channels.splice(element, 1);
+ }
+ }
}
var ChannelStore = new ChannelStoreClass();
@@ -349,6 +357,7 @@ ChannelStore.dispatchToken = AppDispatcher.register((payload) => {
break;
case ActionTypes.LEAVE_CHANNEL:
+ ChannelStore.leaveChannel(action.id);
ChannelStore.emitLeave(action.id);
break;