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.

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

Karl Stolley105729ce66b1
diff --git a/web/src/unread_ui.js b/web/src/unread_ui.js
index d59931749ba..1a473a67456 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);
}