summaryrefslogtreecommitdiffstats
path: root/webapp/utils
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2016-10-31 09:11:23 -0400
committerChristopher Speller <crspeller@gmail.com>2016-10-31 09:11:23 -0400
commitd67a2e1f0cdc62a89c39bb3a16adc4a6a4d05eeb (patch)
treec6a6f2f5beae0cec4705f9fd2877f6a6d1b5e0b1 /webapp/utils
parent4887c9228cb90d6a9bfe57c7e21aa507958de4f3 (diff)
downloadchat-d67a2e1f0cdc62a89c39bb3a16adc4a6a4d05eeb.tar.gz
chat-d67a2e1f0cdc62a89c39bb3a16adc4a6a4d05eeb.tar.bz2
chat-d67a2e1f0cdc62a89c39bb3a16adc4a6a4d05eeb.zip
Fix new DMs not showing up in the sidebar (#4374)
Diffstat (limited to 'webapp/utils')
-rw-r--r--webapp/utils/channel_utils.jsx6
1 files changed, 5 insertions, 1 deletions
diff --git a/webapp/utils/channel_utils.jsx b/webapp/utils/channel_utils.jsx
index 119021fce..113d86ea8 100644
--- a/webapp/utils/channel_utils.jsx
+++ b/webapp/utils/channel_utils.jsx
@@ -35,7 +35,7 @@ export function buildDisplayableChannelList(persistentChannels) {
publicChannels: notFavoriteChannels.filter(isOpenChannel),
privateChannels: notFavoriteChannels.filter(isPrivateChannel),
directChannels: directChannels.filter(isConnectedToTeamMember),
- directNonTeamChannels: directChannels.filter(not(isConnectedToTeamMember))
+ directNonTeamChannels: directChannels.filter(isNotConnectedToTeamMember)
};
}
@@ -119,6 +119,10 @@ function isTeamMember(userId) {
return TeamStore.hasActiveMemberInTeam(TeamStore.getCurrentId(), userId);
}
+function isNotConnectedToTeamMember(channel) {
+ return TeamStore.hasMemberNotInTeam(TeamStore.getCurrentId(), channel.teammate_id);
+}
+
function not(f) {
return (...args) => !f(...args);
}