From 105729ce66b1167692250dac0be0cf9756c8eaaa Mon Sep 17 00:00:00 2001 From: Karl Stolley Date: Wed, 25 Oct 2023 14:38:25 -0400 Subject: [PATCH] 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 --- web/src/unread_ui.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/web/src/unread_ui.js b/web/src/unread_ui.js index d59931749b..1a473a6745 100644 --- a/web/src/unread_ui.js +++ b/web/src/unread_ui.js @@ -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); }