summaryrefslogtreecommitdiffstats
path: root/webapp/utils
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2017-01-17 08:35:07 -0500
committerJoram Wilander <jwawilander@gmail.com>2017-01-17 08:35:07 -0500
commit1fc26a152f81e6d37574e380ace5d8140c034117 (patch)
tree342fa7b78e4def17b0b77f7840ff46eb97991a5c /webapp/utils
parent846880e8140f827253c1be4c5e216065431f4ee3 (diff)
downloadchat-1fc26a152f81e6d37574e380ace5d8140c034117.tar.gz
chat-1fc26a152f81e6d37574e380ace5d8140c034117.tar.bz2
chat-1fc26a152f81e6d37574e380ace5d8140c034117.zip
PLT-5211 Always emove deleted channels for LHS (#5087)
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 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;
}