From 05636b07953e9a257e2500ba14b0e615b68ed3fd Mon Sep 17 00:00:00 2001 From: systemBlue Date: Tue, 2 Jun 2026 18:48:25 -0400 Subject: [PATCH] fix: update the app icon badge in multi-instance mode loadUnreadCount only called UNUserNotificationCenter.setBadgeCount in the single-instance branch, so the system app icon badge went stale for merged accounts. Set the badge from the resolved unread count in both modes. Co-Authored-By: Claude Opus 4.8 (1M context) --- Forji/Forji/Views/HomeView.swift | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Forji/Forji/Views/HomeView.swift b/Forji/Forji/Views/HomeView.swift index c998460..8a321f5 100644 --- a/Forji/Forji/Views/HomeView.swift +++ b/Forji/Forji/Views/HomeView.swift @@ -99,11 +99,15 @@ struct HomeView: View { } else if let notificationService { do { unreadCount = try await notificationService.fetchUnreadCount() - try? await UNUserNotificationCenter.current().setBadgeCount(unreadCount) } catch { - // Silently ignore — badge is non-critical + // Silently ignore — badge is non-critical, keep the prior count + return } + } else { + return } + // Mirror the in-app tab badge to the system app icon badge in both modes + try? await UNUserNotificationCenter.current().setBadgeCount(unreadCount) } }