diff --git a/IceCubesApp/App/Tabs/NotificationTab.swift b/IceCubesApp/App/Tabs/NotificationTab.swift index d8dcd8b6..ba1b47dd 100644 --- a/IceCubesApp/App/Tabs/NotificationTab.swift +++ b/IceCubesApp/App/Tabs/NotificationTab.swift @@ -103,6 +103,9 @@ struct NotificationsTab: View { if selectedTab == .notifications || isSecondaryColumn { if let token = appAccount.currentAccount.oauthToken { userPreferences.notificationsCount[token] = 0 + Task { + let _: ServerError = try await client.post(endpoint: Notifications.clear) + } } watcher.unreadNotificationsCount = 0 } diff --git a/Packages/Notifications/Sources/Notifications/NotificationsViewModel.swift b/Packages/Notifications/Sources/Notifications/NotificationsViewModel.swift index 7255fe9b..3ddc8f47 100644 --- a/Packages/Notifications/Sources/Notifications/NotificationsViewModel.swift +++ b/Packages/Notifications/Sources/Notifications/NotificationsViewModel.swift @@ -162,13 +162,6 @@ import SwiftUI } } - func clear() async { - guard let client else { return } - do { - let _: ServerError = try await client.post(endpoint: Notifications.clear) - } catch {} - } - func handleEvent(event: any StreamEvent) { Task { // Check if the event is a notification,