summaryrefslogtreecommitdiffstats
path: root/webapp/stores
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-12-15 11:40:46 -0500
committerenahum <nahumhbl@gmail.com>2016-12-15 13:40:46 -0300
commit7f48a7fc9d2238134414668e0b520115706b8b2d (patch)
treec7b485e0305a46e10ea997ea3450c2c040efcb95 /webapp/stores
parentc35b95709e293680f882f27ab6e616bf8f92a7cc (diff)
downloadchat-7f48a7fc9d2238134414668e0b520115706b8b2d.tar.gz
chat-7f48a7fc9d2238134414668e0b520115706b8b2d.tar.bz2
chat-7f48a7fc9d2238134414668e0b520115706b8b2d.zip
PLT-4815 Refactor 'More Channels' modal into the new modal pattern (#4742)
* Refactor 'More Channels' modal into the new modal pattern * Fix unit test * Readded CSS changes
Diffstat (limited to 'webapp/stores')
-rw-r--r--webapp/stores/channel_store.jsx19
1 files changed, 11 insertions, 8 deletions
diff --git a/webapp/stores/channel_store.jsx b/webapp/stores/channel_store.jsx
index 0e2c43a60..af7238267 100644
--- a/webapp/stores/channel_store.jsx
+++ b/webapp/stores/channel_store.jsx
@@ -4,6 +4,8 @@
import AppDispatcher from '../dispatcher/app_dispatcher.jsx';
import EventEmitter from 'events';
+import TeamStore from 'stores/team_store.jsx';
+
var Utils;
import {ActionTypes, Constants} from 'utils/constants.jsx';
const NotificationPrefs = Constants.NotificationPrefs;
@@ -233,24 +235,25 @@ class ChannelStoreClass extends EventEmitter {
return this.myChannelMembers;
}
- storeMoreChannels(channels) {
+ storeMoreChannels(channels, teamId = TeamStore.getCurrentId()) {
const newChannels = {};
for (let i = 0; i < channels.length; i++) {
newChannels[channels[i].id] = channels[i];
}
- this.moreChannels = Object.assign({}, this.moreChannels, newChannels);
+ this.moreChannels[teamId] = Object.assign({}, this.moreChannels[teamId], newChannels);
}
- removeMoreChannel(channelId) {
- Reflect.deleteProperty(this.moreChannels, channelId);
+ removeMoreChannel(channelId, teamId = TeamStore.getCurrentId()) {
+ Reflect.deleteProperty(this.moreChannels[teamId], channelId);
}
- getMoreChannels() {
- return Object.assign({}, this.moreChannels);
+ getMoreChannels(teamId = TeamStore.getCurrentId()) {
+ return Object.assign({}, this.moreChannels[teamId]);
}
- getMoreChannelsList() {
- return Object.keys(this.moreChannels).map((cid) => this.moreChannels[cid]);
+ getMoreChannelsList(teamId = TeamStore.getCurrentId()) {
+ const teamChannels = this.moreChannels[teamId] || {};
+ return Object.keys(teamChannels).map((cid) => teamChannels[cid]);
}
storeStats(stats) {