Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

stream_list: Show toggle button above muted/inactive channels.

Evy Kassirerbb43cfe9c76e
diff --git a/web/src/stream_list.ts b/web/src/stream_list.ts
index 08fdee13df9..82b320f1af0 100644
--- a/web/src/stream_list.ts
+++ b/web/src/stream_list.ts
@@ -338,24 +338,23 @@ export function build_stream_list(force_rerender: boolean): void {
for (const stream_id of section.streams) {
add_sidebar_li(stream_id, $(`#stream-list-${section.id}`));
}
- for (const stream_id of [...section.muted_streams, ...section.inactive_streams]) {
- add_sidebar_li(
- stream_id,
- $(`#stream-list-${section.id}`),
- section.id !== "pinned-streams",
- );
- }
- const inactive_or_muted_count =
- section.muted_streams.length + section.inactive_streams.length;
- if (section.id !== "pinned-streams" && inactive_or_muted_count > 0) {
+ const muted_and_inactive_streams = [...section.muted_streams, ...section.inactive_streams];
+ if (section.id !== "pinned-streams" && muted_and_inactive_streams.length > 0) {
$(`#stream-list-${section.id}`).append(
$(
render_show_inactive_or_muted_channels({
- inactive_or_muted_count,
+ inactive_or_muted_count: muted_and_inactive_streams.length,
}),
),
);
}
+ for (const stream_id of muted_and_inactive_streams) {
+ add_sidebar_li(
+ stream_id,
+ $(`#stream-list-${section.id}`),
+ section.id !== "pinned-streams",
+ );
+ }
}
// Rerendering can moving channels between folders and change heading unread counts.