forked from mirrors/linphone-iphone
Replace publisher with delegate in MeetingsListViewModel
This commit is contained in:
parent
8bfcb185d7
commit
72e8ecfd7e
1 changed files with 4 additions and 3 deletions
|
|
@ -26,7 +26,7 @@ class MeetingsListViewModel: ObservableObject {
|
|||
static let ScrollToTodayNotification = Notification.Name("ScrollToToday")
|
||||
|
||||
private var coreContext = CoreContext.shared
|
||||
private var mCoreSuscriptions = Set<AnyCancellable?>()
|
||||
private var mMeetingsListCoreDelegate: CoreDelegate?
|
||||
var selectedMeetingToDelete: MeetingModel?
|
||||
|
||||
@Published var meetingsList: [MeetingsListItemModel] = []
|
||||
|
|
@ -35,10 +35,11 @@ class MeetingsListViewModel: ObservableObject {
|
|||
|
||||
init() {
|
||||
coreContext.doOnCoreQueue { core in
|
||||
self.mCoreSuscriptions.insert(core.publisher?.onConferenceInfoReceived?.postOnCoreQueue { (cbVal: (core: Core, conferenceInfo: ConferenceInfo)) in
|
||||
Log.info("\(MeetingsListViewModel.TAG) Conference info received [\(cbVal.conferenceInfo.uri?.asStringUriOnly() ?? "NIL")")
|
||||
self.mMeetingsListCoreDelegate = CoreDelegateStub(onConferenceInfoReceived: { (_: Core, conferenceInfo: ConferenceInfo) in
|
||||
Log.info("\(MeetingsListViewModel.TAG) Conference info received [\(conferenceInfo.uri?.asStringUriOnly() ?? "NIL")")
|
||||
self.computeMeetingsList()
|
||||
})
|
||||
core.addDelegate(delegate: self.mMeetingsListCoreDelegate!)
|
||||
}
|
||||
computeMeetingsList()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue