Hides favourites category if empty (#5722)

This commit is contained in:
Shaz Amjad 2021-10-08 23:32:19 +11:00 committed by GitHub
parent bd74310f29
commit 000caf09e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -466,6 +466,9 @@ export default class List extends PureComponent {
// Add the rest
if (this.props.categories) {
this.props.categories.reduce((prev, cat) => {
if (cat.type === 'favorites' && !cat.channel_ids.length) {
return prev;
}
prev.push({
name: cat.display_name,
action: cat.type === 'direct_messages' ? this.goToDirectMessages : () => this.showCreateChannelOptions(cat),