navbar: Simplify unread logic on left-sidebar toggle indicator.

This removes former animation logic as well as counts, as the
redesign calls only for showing an unread dot in the presence
of unreads.

Fixes: #27357
This commit is contained in:
Karl Stolley 2023-10-25 14:38:25 -04:00 committed by Tim Abbott
parent 8ee764382b
commit 105729ce66
1 changed files with 3 additions and 11 deletions

View File

@ -62,16 +62,9 @@ export function notify_messages_remain_unread() {
export function set_count_toggle_button($elem, count) {
if (count === 0) {
if ($elem.is(":animated")) {
return $elem.stop(true, true).hide();
}
return $elem.hide(500);
} else if (count > 0 && count < 1000) {
$elem.show(500);
return $elem.text(count);
return $elem.hide();
}
$elem.show(500);
return $elem.text("1k+");
return $elem.show();
}
export function update_unread_counts(skip_animations = false) {
@ -86,8 +79,7 @@ export function update_unread_counts(skip_animations = false) {
hook(res, skip_animations);
}
// Set the unread counts that we show in the buttons that
// toggle open the sidebar menus when we have a thin window.
// Set the unread indicator on the toggle for the left sidebar
set_count_toggle_button($("#streamlist-toggle-unreadcount"), res.home_unread_messages);
}