fix: update the app icon badge in multi-instance mode (#58)

This commit is contained in:
systemBlue 2026-06-04 12:59:43 +02:00 committed by secana
parent 8e56b9d722
commit 4ef76cf2d7

View file

@ -99,11 +99,15 @@ struct HomeView: View {
} else if let notificationService { } else if let notificationService {
do { do {
unreadCount = try await notificationService.fetchUnreadCount() unreadCount = try await notificationService.fetchUnreadCount()
try? await UNUserNotificationCenter.current().setBadgeCount(unreadCount)
} catch { } 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)
} }
} }