diff options
author | Joram Wilander <jwawilander@gmail.com> | 2016-11-04 12:27:19 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-11-04 12:27:19 -0400 |
commit | 00787974d0a87b1a54f15cf75d2dab398546b87e (patch) | |
tree | 6f41b56b10183b6543309b790cd13b1fbf7559af /webapp/stores/user_store.jsx | |
parent | 263f29068386cdd3b5393e00ce97f776532c723f (diff) | |
download | chat-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/user_store.jsx')
-rw-r--r-- | webapp/stores/user_store.jsx | 21 |
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; |