Hides favourites category if empty (#5722) (#5731)

(cherry picked from commit 000caf09e9)

Co-authored-by: Shaz Amjad <shaz.amjad@mattermost.com>
This commit is contained in:
Mattermost Build 2021-10-08 14:38:46 +02:00 committed by GitHub
parent 546487aa08
commit 7538ad2c6f
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),