From 5f3111e8809ccc4fe32cc2958da5a47fd9c09bef Mon Sep 17 00:00:00 2001 From: Christopher Speller Date: Mon, 4 Apr 2016 11:09:59 -0400 Subject: Fxing some channel changing issues --- webapp/stores/channel_store.jsx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'webapp/stores') 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(); } -- cgit v1.2.3-1-g7c22