This commit is contained in:
Thomas Ricouard 2024-07-17 16:53:04 +02:00
parent 07bbd6dc13
commit ce27e4dda5
2 changed files with 13 additions and 13 deletions

View file

@ -81,10 +81,12 @@ struct NotificationsTab: View {
private func clearNotifications() {
if selectedTab == .notifications || isSecondaryColumn {
if let token = appAccount.currentAccount.oauthToken {
if let token = appAccount.currentAccount.oauthToken, userPreferences.notificationsCount[token] ?? 0 > 0 {
userPreferences.notificationsCount[token] = 0
}
watcher.unreadNotificationsCount = 0
if watcher.unreadNotificationsCount > 0 {
watcher.unreadNotificationsCount = 0
}
}
}
}

View file

@ -29,19 +29,17 @@ public struct NotificationsListView: View {
}
public var body: some View {
ScrollViewReader { proxy in
List {
scrollToTopView
topPaddingView
if lockedAccountId == nil, let summary = viewModel.policy?.summary {
NotificationsHeaderFilteredView(filteredNotifications: summary)
}
notificationsView
List {
scrollToTopView
topPaddingView
if lockedAccountId == nil, let summary = viewModel.policy?.summary {
NotificationsHeaderFilteredView(filteredNotifications: summary)
}
.id(account.account?.id)
.environment(\.defaultMinListRowHeight, 1)
.listStyle(.plain)
notificationsView
}
.id(account.account?.id)
.environment(\.defaultMinListRowHeight, 1)
.listStyle(.plain)
.toolbar {
ToolbarItem(placement: .principal) {
let title = lockedType?.menuTitle() ?? viewModel.selectedType?.menuTitle() ?? "notifications.navigation-title"