diff --git a/IceCubesApp/App/Tabs/NotificationTab.swift b/IceCubesApp/App/Tabs/NotificationTab.swift index 301e60ae..963cad49 100644 --- a/IceCubesApp/App/Tabs/NotificationTab.swift +++ b/IceCubesApp/App/Tabs/NotificationTab.swift @@ -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 + } } } } diff --git a/Packages/Notifications/Sources/Notifications/NotificationsListView.swift b/Packages/Notifications/Sources/Notifications/NotificationsListView.swift index e0ab4f0e..42b878b0 100644 --- a/Packages/Notifications/Sources/Notifications/NotificationsListView.swift +++ b/Packages/Notifications/Sources/Notifications/NotificationsListView.swift @@ -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"