diff options
Diffstat (limited to 'webapp/stores')
-rw-r--r-- | webapp/stores/channel_store.jsx | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/webapp/stores/channel_store.jsx b/webapp/stores/channel_store.jsx index d578a5d29..0e2c43a60 100644 --- a/webapp/stores/channel_store.jsx +++ b/webapp/stores/channel_store.jsx @@ -234,11 +234,23 @@ class ChannelStoreClass extends EventEmitter { } storeMoreChannels(channels) { - this.moreChannels = channels; + const newChannels = {}; + for (let i = 0; i < channels.length; i++) { + newChannels[channels[i].id] = channels[i]; + } + this.moreChannels = Object.assign({}, this.moreChannels, newChannels); + } + + removeMoreChannel(channelId) { + Reflect.deleteProperty(this.moreChannels, channelId); } getMoreChannels() { - return this.moreChannels; + return Object.assign({}, this.moreChannels); + } + + getMoreChannelsList() { + return Object.keys(this.moreChannels).map((cid) => this.moreChannels[cid]); } storeStats(stats) { |