mirror of
https://github.com/zulip/zulip.git
synced 2025-10-25 09:03:57 +00:00
channel_folders: Don't label section OTHER if there are no folders above it.
Fixes #35878.
(cherry picked from commit c52174a0a2)
This commit is contained in:
@@ -859,7 +859,7 @@ function get_folder_name_from_id(folder_id: number): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (folder_id === OTHER_CHANNELS_FOLDER_ID) {
|
if (folder_id === OTHER_CHANNELS_FOLDER_ID) {
|
||||||
return $t({defaultMessage: "CHANNELS"});
|
return $t({defaultMessage: "OTHER CHANNELS"});
|
||||||
}
|
}
|
||||||
|
|
||||||
return channel_folders.get_channel_folder_by_id(folder_id).name;
|
return channel_folders.get_channel_folder_by_id(folder_id).name;
|
||||||
|
|||||||
@@ -234,6 +234,15 @@ export function sort_groups(
|
|||||||
(section_a, section_b) => section_a.order! - section_b.order!,
|
(section_a, section_b) => section_a.order! - section_b.order!,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (
|
||||||
|
pinned_section.streams.length > 0 ||
|
||||||
|
pinned_section.muted_streams.length > 0 ||
|
||||||
|
pinned_section.inactive_streams.length > 0 ||
|
||||||
|
folder_sections.size > 0
|
||||||
|
) {
|
||||||
|
normal_section.section_title = $t({defaultMessage: "OTHER"});
|
||||||
|
}
|
||||||
|
|
||||||
// This needs to have the same ordering as the order they're displayed in the sidebar.
|
// This needs to have the same ordering as the order they're displayed in the sidebar.
|
||||||
const new_sections = [pinned_section, ...folder_sections_sorted, normal_section];
|
const new_sections = [pinned_section, ...folder_sections_sorted, normal_section];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user