From fbcc67f2753577486d49976f865c5d4ed4191698 Mon Sep 17 00:00:00 2001 From: Jakub <106778416+MarekZegare4@users.noreply.github.com> Date: Sun, 5 Jul 2026 22:51:56 +0200 Subject: [PATCH] style(ui): drop dead if(found) guard in favourites badge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The favourites render already continues on !found (gone-slot prune), so the badge block only runs when found is true. The if(found) guard around the unread-badge lookup was always true — remove it. Co-Authored-By: Claude Opus 4.8 --- examples/companion_radio/ui-new/UITask.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/examples/companion_radio/ui-new/UITask.cpp b/examples/companion_radio/ui-new/UITask.cpp index 2ab94163..e703e3f4 100644 --- a/examples/companion_radio/ui-new/UITask.cpp +++ b/examples/companion_radio/ui-new/UITask.cpp @@ -1239,12 +1239,10 @@ public: // before it instead of underneath. Badge and name share one baseline. char badge[5] = ""; int bw = 0; - if (found) { - uint8_t unread = _task->getDMUnread(ci.id.pub_key); - if (unread > 0) { - snprintf(badge, sizeof(badge), "%d", unread); - bw = display.getTextWidth(badge) + 3; // badge + 3 px gap - } + uint8_t unread = _task->getDMUnread(ci.id.pub_key); + if (unread > 0) { + snprintf(badge, sizeof(badge), "%d", unread); + bw = display.getTextWidth(badge) + 3; // badge + 3 px gap } int name_y = cy + (cell_h - line_h) / 2; int name_max_w = cell_w - 4 - bw;