diff options
| author | Christian Cleberg <[email protected]> | 2026-04-20 13:04:57 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-04-20 13:04:57 -0500 |
| commit | 8b73fd9cd43753b36b3ab3ca5e4dc83a47ea3480 (patch) | |
| tree | 25658dbdc28775764f5745576c240efd38fd4685 /Hutch/Views/Home | |
| parent | d29fbef60abdffaee190b758530dde9212745ed2 (diff) | |
| download | hutch-8b73fd9cd43753b36b3ab3ca5e4dc83a47ea3480.tar.gz hutch-8b73fd9cd43753b36b3ab3ca5e4dc83a47ea3480.tar.bz2 hutch-8b73fd9cd43753b36b3ab3ca5e4dc83a47ea3480.zip | |
fix: add mark all read actions and avoid resending unchanged repo metadata
Diffstat (limited to 'Hutch/Views/Home')
| -rw-r--r-- | Hutch/Views/Home/HomeViewModel.swift | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Hutch/Views/Home/HomeViewModel.swift b/Hutch/Views/Home/HomeViewModel.swift index 4bd4f32..6016a11 100644 --- a/Hutch/Views/Home/HomeViewModel.swift +++ b/Hutch/Views/Home/HomeViewModel.swift @@ -627,6 +627,20 @@ final class HomeViewModel { persistNeedsAttentionSnapshot() } + func markAllInboxThreadsRead() { + guard !unreadInboxThreads.isEmpty else { return } + + let viewedAt = Date() + for thread in unreadInboxThreads { + InboxReadStateStore.markViewed(max(viewedAt, thread.lastActivityAt), for: thread.id, defaults: defaults) + } + + unreadInboxThreads = [] + unreadInboxThreadCount = 0 + hasUnreadInboxThreads = false + persistNeedsAttentionSnapshot() + } + func markInboxThreadUnread(_ thread: InboxThreadSummary) { InboxReadStateStore.markUnread(for: thread.id, defaults: defaults) if unreadInboxThreads.contains(where: { $0.id == thread.id }) == false { |
