From 4ef76cf2d7dc678c1ec47eb374475891dd298432 Mon Sep 17 00:00:00 2001 From: systemBlue Date: Thu, 4 Jun 2026 12:59:43 +0200 Subject: [PATCH] fix: update the app icon badge in multi-instance mode (#58) --- 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) } }