From 9bc9961f345f22e78d9788cd35c5534c8948b415 Mon Sep 17 00:00:00 2001 From: Thomas Ricouard Date: Wed, 26 Jun 2024 13:32:36 +0200 Subject: [PATCH] Fix filtered notifications --- Packages/Models/Sources/Models/NotificationsPolicy.swift | 4 ++-- .../Notifications/NotificationsHeaderFilteredView.swift | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Packages/Models/Sources/Models/NotificationsPolicy.swift b/Packages/Models/Sources/Models/NotificationsPolicy.swift index 25a120a00..3d1236065 100644 --- a/Packages/Models/Sources/Models/NotificationsPolicy.swift +++ b/Packages/Models/Sources/Models/NotificationsPolicy.swift @@ -8,7 +8,7 @@ public struct NotificationsPolicy: Codable, Sendable { public let summary: Summary public struct Summary: Codable, Sendable { - public let pendingRequestsCount: String - public let pendingNotificationsCount: String + public let pendingRequestsCount: Int + public let pendingNotificationsCount: Int } } diff --git a/Packages/Notifications/Sources/Notifications/NotificationsHeaderFilteredView.swift b/Packages/Notifications/Sources/Notifications/NotificationsHeaderFilteredView.swift index 6cd47e538..dbb3c0bb1 100644 --- a/Packages/Notifications/Sources/Notifications/NotificationsHeaderFilteredView.swift +++ b/Packages/Notifications/Sources/Notifications/NotificationsHeaderFilteredView.swift @@ -10,12 +10,12 @@ struct NotificationsHeaderFilteredView: View { let filteredNotifications: NotificationsPolicy.Summary var body: some View { - if let count = Int(filteredNotifications.pendingNotificationsCount), count > 0 { + if filteredNotifications.pendingNotificationsCount > 0 { HStack { Label("notifications.content-filter.requests.title", systemImage: "archivebox") .foregroundStyle(.secondary) Spacer() - Text(filteredNotifications.pendingNotificationsCount) + Text("\(filteredNotifications.pendingNotificationsCount)") .font(.footnote) .fontWeight(.semibold) .monospacedDigit()