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() { private func clearNotifications() {
if selectedTab == .notifications || isSecondaryColumn { 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 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 { public var body: some View {
ScrollViewReader { proxy in List {
List { scrollToTopView
scrollToTopView topPaddingView
topPaddingView if lockedAccountId == nil, let summary = viewModel.policy?.summary {
if lockedAccountId == nil, let summary = viewModel.policy?.summary { NotificationsHeaderFilteredView(filteredNotifications: summary)
NotificationsHeaderFilteredView(filteredNotifications: summary)
}
notificationsView
} }
.id(account.account?.id) notificationsView
.environment(\.defaultMinListRowHeight, 1)
.listStyle(.plain)
} }
.id(account.account?.id)
.environment(\.defaultMinListRowHeight, 1)
.listStyle(.plain)
.toolbar { .toolbar {
ToolbarItem(placement: .principal) { ToolbarItem(placement: .principal) {
let title = lockedType?.menuTitle() ?? viewModel.selectedType?.menuTitle() ?? "notifications.navigation-title" let title = lockedType?.menuTitle() ?? viewModel.selectedType?.menuTitle() ?? "notifications.navigation-title"