From fa807d8e436e87b8c1749ea54c293a15c67f7f29 Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Wed, 27 Apr 2016 16:02:58 -0400 Subject: Fixing permalinks to channels your not a memeber of (#2805) --- webapp/stores/channel_store.jsx | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'webapp/stores') 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; -- cgit v1.2.3-1-g7c22