Fxing some channel changing issues

Этот коммит содержится в:
Christopher Speller
2016-04-04 11:09:59 -04:00
родитель 785553384f
Коммит 5f3111e880
11 изменённых файлов: 90 добавлений и 45 удалений

Просмотреть файл

@@ -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();
}