fix: refresh the merged notifications list when a push notification is opened

Tapping a push notification bumps NavigationState's refresh trigger so
the notifications tab reloads on arrival. The single-instance overview
observes the trigger, but the merged multi-instance overview never did,
so multi-instance users landed on a stale list that still showed the
tapped thread as unread until a manual pull-to-refresh.

Observe the same trigger in the merged overview, mirroring
NotificationsOverviewView.
This commit is contained in:
systemblue 2026-06-05 22:01:31 -04:00
parent 2a679140e6
commit 7ce43b09be

View file

@ -6,6 +6,7 @@ struct MergedNotificationsOverviewView: View {
@State private var pagination: PaginationState<TaggedItem<NotificationThread>>
@State private var statusFilter: String = "unread"
@Environment(NavigationState.self) private var navigationState
init(manager: MultiInstanceManager) {
self.manager = manager
@ -95,6 +96,9 @@ struct MergedNotificationsOverviewView: View {
.onChange(of: statusFilter) {
reloadNotifications(clearItems: true)
}
.onChange(of: navigationState.notificationsRefreshTrigger) {
reloadNotifications()
}
.errorAlert(message: $pagination.errorMessage, isPresented: $pagination.showError)
}