summaryrefslogtreecommitdiffstats
path: root/webapp/stores
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-11-04 12:27:19 -0400
committerChristopher Speller <crspeller@gmail.com>2016-11-04 12:27:19 -0400
commit00787974d0a87b1a54f15cf75d2dab398546b87e (patch)
tree6f41b56b10183b6543309b790cd13b1fbf7559af /webapp/stores
parent263f29068386cdd3b5393e00ce97f776532c723f (diff)
downloadchat-00787974d0a87b1a54f15cf75d2dab398546b87e.tar.gz
chat-00787974d0a87b1a54f15cf75d2dab398546b87e.tar.bz2
chat-00787974d0a87b1a54f15cf75d2dab398546b87e.zip
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
Diffstat (limited to 'webapp/stores')
-rw-r--r--webapp/stores/user_store.jsx21
1 files changed, 15 insertions, 6 deletions
diff --git a/webapp/stores/user_store.jsx b/webapp/stores/user_store.jsx
index bb3415a7d..71b98d2e5 100644
--- a/webapp/stores/user_store.jsx
+++ b/webapp/stores/user_store.jsx
@@ -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;