diff options
Diffstat (limited to 'webapp/stores/channel_store.jsx')
-rw-r--r-- | webapp/stores/channel_store.jsx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/webapp/stores/channel_store.jsx b/webapp/stores/channel_store.jsx index b2946e326..9437d5e44 100644 --- a/webapp/stores/channel_store.jsx +++ b/webapp/stores/channel_store.jsx @@ -95,7 +95,12 @@ class ChannelStoreClass extends EventEmitter { this.removeListener(LEAVE_EVENT, callback); } findFirstBy(field, value) { - var channels = this.getChannels(); + return this.doFindFirst(field, value, this.getChannels()); + } + findFirstMoreBy(field, value) { + return this.doFindFirst(field, value, this.getMoreChannels()); + } + doFindFirst(field, value, channels) { for (var i = 0; i < channels.length; i++) { if (channels[i][field] === value) { return channels[i]; @@ -113,6 +118,9 @@ class ChannelStoreClass extends EventEmitter { getByName(name) { return this.findFirstBy('name', name); } + getMoreByName(name) { + return this.findFirstMoreBy('name', name); + } getAll() { return this.getChannels(); } |