From 1fc26a152f81e6d37574e380ace5d8140c034117 Mon Sep 17 00:00:00 2001 From: Corey Hulen Date: Tue, 17 Jan 2017 08:35:07 -0500 Subject: PLT-5211 Always emove deleted channels for LHS (#5087) --- 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 ffc69d7b4..14a0e63b3 100644 --- a/webapp/utils/channel_utils.jsx +++ b/webapp/utils/channel_utils.jsx @@ -23,7 +23,7 @@ import LocalizationStore from 'stores/localization_store.jsx'; export function buildDisplayableChannelList(persistentChannels) { const missingDMChannels = createMissingDirectChannels(persistentChannels); - const channels = persistentChannels.concat(missingDMChannels).map(completeDirectChannelInfo); + const channels = persistentChannels.concat(missingDMChannels).map(completeDirectChannelInfo).filter(isNotDeletedChannel); channels.sort(sortChannelsByDisplayName); const favoriteChannels = channels.filter(isFavoriteChannel); @@ -43,6 +43,10 @@ export function isFavoriteChannel(channel) { return PreferenceStore.getBool(Preferences.CATEGORY_FAVORITE_CHANNEL, channel.id); } +export function isNotDeletedChannel(channel) { + return channel.delete_at === 0; +} + export function isOpenChannel(channel) { return channel.type === Constants.OPEN_CHANNEL; } -- cgit v1.2.3-1-g7c22