From d67a2e1f0cdc62a89c39bb3a16adc4a6a4d05eeb Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Mon, 31 Oct 2016 09:11:23 -0400 Subject: Fix new DMs not showing up in the sidebar (#4374) --- webapp/utils/channel_utils.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'webapp/utils') 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); } -- cgit v1.2.3-1-g7c22