summaryrefslogtreecommitdiff
path: root/Hutch/Views/Home
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-04-01 12:15:23 -0500
committerChristian Cleberg <[email protected]>2026-04-01 12:15:23 -0500
commit109b0ea7e859de2d8b5a4dc22bf0472fd3b08eaa (patch)
treeceb604cbf07102b3b386a60fd48a9dc2576e3684 /Hutch/Views/Home
parent367a9d8e9592d0c604356e74edea97e0791b32cd (diff)
downloadhutch-109b0ea7e859de2d8b5a4dc22bf0472fd3b08eaa.tar.gz
hutch-109b0ea7e859de2d8b5a4dc22bf0472fd3b08eaa.tar.bz2
hutch-109b0ea7e859de2d8b5a4dc22bf0472fd3b08eaa.zip
fix: fixed inbox's inconsistent UX and adds a Mark All Read button
Fixes: https://todo.sr.ht/~ccleberg/Hutch/10
Diffstat (limited to 'Hutch/Views/Home')
-rw-r--r--Hutch/Views/Home/HomeView.swift28
1 files changed, 13 insertions, 15 deletions
diff --git a/Hutch/Views/Home/HomeView.swift b/Hutch/Views/Home/HomeView.swift
index d3d370a..35e8f7c 100644
--- a/Hutch/Views/Home/HomeView.swift
+++ b/Hutch/Views/Home/HomeView.swift
@@ -26,11 +26,18 @@ struct HomeView: View {
}
}
.task {
- if viewModel == nil, let currentUser = appState.currentUser {
- let vm = HomeViewModel(currentUser: currentUser, client: appState.client)
- viewModel = vm
- await vm.loadDashboard()
+ guard let currentUser = appState.currentUser else { return }
+
+ let vm: HomeViewModel
+ if let viewModel {
+ vm = viewModel
+ } else {
+ let newViewModel = HomeViewModel(currentUser: currentUser, client: appState.client)
+ viewModel = newViewModel
+ vm = newViewModel
}
+
+ await vm.loadDashboard()
}
}
@@ -214,17 +221,8 @@ private struct HomeInboxToolbarIcon: View {
let hasUnreadThreads: Bool
var body: some View {
- ZStack(alignment: .topTrailing) {
- Image(systemName: hasUnreadThreads ? "tray.fill" : "tray")
-
- if hasUnreadThreads {
- Circle()
- .fill(.blue)
- .frame(width: 9, height: 9)
- .offset(x: 4, y: -2)
- }
- }
- .accessibilityLabel(hasUnreadThreads ? "Inbox, unread messages" : "Inbox")
+ Image(systemName: hasUnreadThreads ? "tray.fill" : "tray")
+ .accessibilityLabel(hasUnreadThreads ? "Inbox, unread messages" : "Inbox")
}
}