diff options
author | Christopher Speller <crspeller@gmail.com> | 2016-04-27 16:02:58 -0400 |
---|---|---|
committer | Harrison Healey <harrisonmhealey@gmail.com> | 2016-04-27 16:02:58 -0400 |
commit | fa807d8e436e87b8c1749ea54c293a15c67f7f29 (patch) | |
tree | 9557bb5342425dffd3606cb03f1378de5f5cc032 /webapp/stores | |
parent | d962e175f838817f4db060227cf8b5e2258b887c (diff) | |
download | chat-fa807d8e436e87b8c1749ea54c293a15c67f7f29.tar.gz chat-fa807d8e436e87b8c1749ea54c293a15c67f7f29.tar.bz2 chat-fa807d8e436e87b8c1749ea54c293a15c67f7f29.zip |
Fixing permalinks to channels your not a memeber of (#2805)
Diffstat (limited to 'webapp/stores')
-rw-r--r-- | webapp/stores/channel_store.jsx | 9 |
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; |