From 8bfcb185d7dfa6fdb2c7007fb2e2947e6ee7fd04 Mon Sep 17 00:00:00 2001 From: QuentinArguillere Date: Tue, 10 Sep 2024 17:55:11 +0200 Subject: [PATCH] Replace publisher with delegate in HistoryListViewModel --- .../UI/Main/History/ViewModel/HistoryListViewModel.swift | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Linphone/UI/Main/History/ViewModel/HistoryListViewModel.swift b/Linphone/UI/Main/History/ViewModel/HistoryListViewModel.swift index 036365ef2..bc3cd9798 100644 --- a/Linphone/UI/Main/History/ViewModel/HistoryListViewModel.swift +++ b/Linphone/UI/Main/History/ViewModel/HistoryListViewModel.swift @@ -28,7 +28,7 @@ class HistoryListViewModel: ObservableObject { var callLogsTmp: [HistoryModel] = [] var callLogsAddressToDelete = "" - var callLogSubscription: AnyCancellable? + var callLogCoreDelegate: CoreDelegate? @Published var missedCallsCount: Int = 0 @@ -59,7 +59,7 @@ class HistoryListViewModel: ObservableObject { self.callLogsTmp = callLogsTmpBis } - self.callLogSubscription = core.publisher?.onCallLogUpdated?.postOnCoreQueue { (_: (_: Core, _: CallLog)) in + self.callLogCoreDelegate = CoreDelegateStub(onCallLogUpdated: { (_: Core, _: CallLog) in let account = core.defaultAccount let logs = account?.callLogs != nil ? account!.callLogs : core.callLogs @@ -81,7 +81,8 @@ class HistoryListViewModel: ObservableObject { } self.updateMissedCallsCount() - } + }) + core.addDelegate(delegate: self.callLogCoreDelegate!) } }