mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 14:03:30 +00:00
channel_folders: Fix unread counts for show_channel_folders option.
Previously the counts were being generated assuming `show_channel_folders` was true. But when we're not showing folders, the unread counts for folders need to be distributed to the "normal" section.
This commit is contained in:
@@ -819,7 +819,7 @@ export let update_dom_with_unread_counts = function (counts: FullUnreadCountsDat
|
|||||||
if (sub.pin_to_top) {
|
if (sub.pin_to_top) {
|
||||||
pinned_unread_counts.unmuted += stream_count_info.unmuted_count;
|
pinned_unread_counts.unmuted += stream_count_info.unmuted_count;
|
||||||
pinned_unread_counts.muted += stream_count_info.muted_count;
|
pinned_unread_counts.muted += stream_count_info.muted_count;
|
||||||
} else if (sub.folder_id !== null) {
|
} else if (sub.folder_id !== null && user_settings.web_left_sidebar_show_channel_folders) {
|
||||||
if (!folder_unread_counts.has(sub.folder_id)) {
|
if (!folder_unread_counts.has(sub.folder_id)) {
|
||||||
folder_unread_counts.set(sub.folder_id, {
|
folder_unread_counts.set(sub.folder_id, {
|
||||||
unmuted: 0,
|
unmuted: 0,
|
||||||
@@ -894,6 +894,7 @@ export let update_dom_with_unread_counts = function (counts: FullUnreadCountsDat
|
|||||||
normal_section_unread_counts.muted_channel_muted,
|
normal_section_unread_counts.muted_channel_muted,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (user_settings.web_left_sidebar_show_channel_folders) {
|
||||||
for (const folder_id of channel_folders.get_all_folder_ids()) {
|
for (const folder_id of channel_folders.get_all_folder_ids()) {
|
||||||
const unread_counts = folder_unread_counts.get(folder_id) ?? {
|
const unread_counts = folder_unread_counts.get(folder_id) ?? {
|
||||||
unmuted: 0,
|
unmuted: 0,
|
||||||
@@ -914,6 +915,7 @@ export let update_dom_with_unread_counts = function (counts: FullUnreadCountsDat
|
|||||||
unread_counts.inactive_muted + unread_counts.muted_channel_muted,
|
unread_counts.inactive_muted + unread_counts.muted_channel_muted,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export function rewire_update_dom_with_unread_counts(
|
export function rewire_update_dom_with_unread_counts(
|
||||||
|
|||||||
Reference in New Issue
Block a user