summaryrefslogtreecommitdiffstats
path: root/webapp/stores
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2016-04-04 11:09:59 -0400
committerChristopher Speller <crspeller@gmail.com>2016-04-04 11:09:59 -0400
commit5f3111e8809ccc4fe32cc2958da5a47fd9c09bef (patch)
tree5f84d08557797f6363fc30647967ac227eaa12b6 /webapp/stores
parent785553384fe96027b0e9274b6ccc8623092eda70 (diff)
downloadchat-5f3111e8809ccc4fe32cc2958da5a47fd9c09bef.tar.gz
chat-5f3111e8809ccc4fe32cc2958da5a47fd9c09bef.tar.bz2
chat-5f3111e8809ccc4fe32cc2958da5a47fd9c09bef.zip
Fxing some channel changing issues
Diffstat (limited to 'webapp/stores')
-rw-r--r--webapp/stores/channel_store.jsx10
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();
}