From 7538ad2c6fca8db390295df6fb1921d8d09c67ec Mon Sep 17 00:00:00 2001 From: Mattermost Build Date: Fri, 8 Oct 2021 14:38:46 +0200 Subject: [PATCH] Hides favourites category if empty (#5722) (#5731) (cherry picked from commit 000caf09e9927456c319cc2d8da85270e1796b5d) Co-authored-by: Shaz Amjad --- app/components/sidebars/main/channels_list/list/list.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/components/sidebars/main/channels_list/list/list.js b/app/components/sidebars/main/channels_list/list/list.js index 04a490fcc..152bf42f5 100644 --- a/app/components/sidebars/main/channels_list/list/list.js +++ b/app/components/sidebars/main/channels_list/list/list.js @@ -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),