left_sidebar: Fix section divider not shown when all streams are muted.

This fixes a bug where when all the streams in a section
in the left sidebar are muted, the section divider disappears.

The bug is caused by not considering muted streams when writing
the logic for when to show/not show section divider this commit
fixes it.

fixes #23241.
This commit is contained in:
Hemant Umre 2022-11-23 19:33:42 +05:30 committed by Tim Abbott
parent 8241e2d353
commit a451fe861e
1 changed files with 5 additions and 2 deletions

View File

@ -142,9 +142,12 @@ export function build_stream_list(force_rerender) {
topic_list.clear(); topic_list.clear();
$parent.empty(); $parent.empty();
const any_pinned_streams = stream_groups.pinned_streams.length > 0; const any_pinned_streams =
const any_normal_streams = stream_groups.normal_streams.length > 0; stream_groups.pinned_streams.length > 0 || stream_groups.muted_pinned_streams.length > 0;
const any_normal_streams =
stream_groups.normal_streams.length > 0 || stream_groups.muted_active_streams.length > 0;
const any_dormant_streams = stream_groups.dormant_streams.length > 0; const any_dormant_streams = stream_groups.dormant_streams.length > 0;
const need_section_subheaders = const need_section_subheaders =
(any_pinned_streams ? 1 : 0) + (any_pinned_streams ? 1 : 0) +
(any_normal_streams ? 1 : 0) + (any_normal_streams ? 1 : 0) +