From 94d0b581bbd2be7b63c07fe7f86d736daa96e1f9 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Tue, 24 Mar 2026 18:28:21 -0500 Subject: v2.4.0: widgets --- Hutch/Views/Inbox/InboxViewModel.swift | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Hutch/Views/Inbox') diff --git a/Hutch/Views/Inbox/InboxViewModel.swift b/Hutch/Views/Inbox/InboxViewModel.swift index 42ce223..1d4cfd3 100644 --- a/Hutch/Views/Inbox/InboxViewModel.swift +++ b/Hutch/Views/Inbox/InboxViewModel.swift @@ -136,6 +136,7 @@ final class InboxViewModel { } return lhs.lastActivityAt > rhs.lastActivityAt } + NeedsAttentionSnapshotStore.update(unreadInboxThreads: threads.count) } catch { inboxListLogger.error("Inbox request failed") self.error = "Failed to load inbox" @@ -146,11 +147,13 @@ final class InboxViewModel { let viewedAt = max(Date(), thread.lastActivityAt) InboxReadStateStore.markViewed(viewedAt, for: thread.id) threads.removeAll { $0.id == thread.id } + NeedsAttentionSnapshotStore.adjustUnreadInboxThreads(by: -1) } func markThreadUnread(_ thread: InboxThreadSummary) { InboxReadStateStore.markUnread(for: thread.id) updateThread(thread, isUnread: true) + NeedsAttentionSnapshotStore.adjustUnreadInboxThreads(by: 1) } func toggleThreadReadState(_ thread: InboxThreadSummary) { -- cgit v1.2.3