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