summaryrefslogtreecommitdiffstats
path: root/webapp/stores/user_store.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/stores/user_store.jsx')
-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;