PLT-4481 Fix member count for team user lists and channel invite list (#4422)

* Fix member count for team user lists and channel invite list

* Fix client unit test
Этот коммит содержится в:
Joram Wilander
2016-11-04 12:27:19 -04:00
коммит произвёл Christopher Speller
родитель 263f290683
Коммит 00787974d0
11 изменённых файлов: 131 добавлений и 34 удалений

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

@@ -320,6 +320,10 @@ class UserStoreClass extends EventEmitter {
for (let i = 0; i < userIds.length; i++) {
const profile = this.getProfile(userIds[i]);
if (!profile) {
continue;
}
if (skipCurrent && profile.id === currentId) {
continue;
}
@@ -328,9 +332,7 @@ class UserStoreClass extends EventEmitter {
continue;
}
if (profile) {
profiles.push(profile);
}
profiles.push(profile);
}
return profiles;
@@ -473,15 +475,22 @@ class UserStoreClass extends EventEmitter {
userIds.splice(index, 1);
}
getProfileListNotInChannel(channelId = ChannelStore.getCurrentId()) {
getProfileListNotInChannel(channelId = ChannelStore.getCurrentId(), skipInactive = false) {
const userIds = this.profiles_not_in_channel[channelId] || [];
const profiles = [];
for (let i = 0; i < userIds.length; i++) {
const profile = this.getProfile(userIds[i]);
if (profile) {
profiles.push(profile);
if (!profile) {
continue;
}
if (skipInactive && profile.delete_at > 0) {
continue;
}
profiles.push(profile);
}
return profiles;