This commit is contained in:
Thomas Ricouard 2023-12-26 13:56:28 +01:00
parent f3a48118f0
commit ede45a9d46
2 changed files with 3 additions and 7 deletions

View file

@ -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
}

View file

@ -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,