mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
Replace publisher with delegate in HistoryListViewModel
This commit is contained in:
parent
502747d72e
commit
8bfcb185d7
1 changed files with 4 additions and 3 deletions
|
|
@ -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!)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue