fix(ui): keep chat unread badge visible

This commit is contained in:
liu weikai
2026-07-16 09:47:19 +08:00
parent ac792b5d0d
commit d8e6a85aed
2 changed files with 79 additions and 11 deletions
+9 -2
View File
@@ -256,8 +256,15 @@ void apply_menu_badge(const StatusSnapshot& snap)
return;
}
char buf[12];
snprintf(buf, sizeof(buf), "%d", snap.unread);
char buf[4];
if (snap.unread > 99)
{
snprintf(buf, sizeof(buf), "99+");
}
else
{
snprintf(buf, sizeof(buf), "%d", snap.unread);
}
lv_label_set_text(s_chat_badge_label, buf);
lv_obj_clear_flag(s_chat_badge, LV_OBJ_FLAG_HIDDEN);
}