Compute notifications count in core queue

This commit is contained in:
Benoit Martins 2025-09-15 15:33:58 +02:00
parent d3984b4b1a
commit a2564c4cc0

View file

@ -154,11 +154,14 @@ class AccountModel: ObservableObject {
}
private func computeNotificationsCount() {
let count = account.unreadChatMessageCount + account.missedCallsCount
CoreContext.shared.doOnCoreQueue { core in
let count = self.account.unreadChatMessageCount + self.account.missedCallsCount
SharedMainViewModel.shared.updateMissedCallsCount()
SharedMainViewModel.shared.updateUnreadMessagesCount()
DispatchQueue.main.async { [self] in
notificationsCount = count
DispatchQueue.main.async {
self.notificationsCount = count
}
}
}