From a2564c4cc0d511ae3deb61891f01dacbb9d9a876 Mon Sep 17 00:00:00 2001 From: Benoit Martins Date: Mon, 15 Sep 2025 15:33:58 +0200 Subject: [PATCH] Compute notifications count in core queue --- Linphone/UI/Main/Viewmodel/AccountModel.swift | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Linphone/UI/Main/Viewmodel/AccountModel.swift b/Linphone/UI/Main/Viewmodel/AccountModel.swift index 6944cce9c..7cda43649 100644 --- a/Linphone/UI/Main/Viewmodel/AccountModel.swift +++ b/Linphone/UI/Main/Viewmodel/AccountModel.swift @@ -154,11 +154,14 @@ class AccountModel: ObservableObject { } private func computeNotificationsCount() { - let count = account.unreadChatMessageCount + account.missedCallsCount - SharedMainViewModel.shared.updateMissedCallsCount() - SharedMainViewModel.shared.updateUnreadMessagesCount() - DispatchQueue.main.async { [self] in - notificationsCount = count + CoreContext.shared.doOnCoreQueue { core in + let count = self.account.unreadChatMessageCount + self.account.missedCallsCount + SharedMainViewModel.shared.updateMissedCallsCount() + SharedMainViewModel.shared.updateUnreadMessagesCount() + + DispatchQueue.main.async { + self.notificationsCount = count + } } }