PLT-5211 Always emove deleted channels for LHS (#5087)

Этот коммит содержится в:
Corey Hulen
2017-01-17 08:35:07 -05:00
коммит произвёл Joram Wilander
родитель 846880e814
Коммит 1fc26a152f

Просмотреть файл

@@ -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;
}