Fixing permalinks to channels your not a memeber of (#2805)

Этот коммит содержится в:
Christopher Speller
2016-04-27 16:02:58 -04:00
коммит произвёл Harrison Healey
родитель d962e175f8
Коммит fa807d8e43
13 изменённых файлов: 250 добавлений и 53 удалений

Просмотреть файл

@@ -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;