Skip to content
Snippets Groups Projects
Commit a329521e authored by Kateryna Kostiuk's avatar Kateryna Kostiuk
Browse files

calls: remove unnecessary call provider updates

The conversation manager updates the call provider state,
so it is not necessary to do this in the view controller as well.

Change-Id: Idacd50a068acd41740b7130dcdc0af83fa2ae23b
parent 7f869669
No related branches found
No related tags found
No related merge requests found
......@@ -241,13 +241,13 @@ class CallViewController: UIViewController, StoryboardBased, ViewModelBased, Con
self.buttonsContainer.viewModel = self.viewModel.containerViewModel
self.buttonsContainer.cancelButton.rx.tap
.subscribe(onNext: { [weak self] in
self?.viewModel.cancelCall(stopProvider: true)
self?.viewModel.cancelCall()
self?.removeFromScreen()
})
.disposed(by: self.disposeBag)
self.buttonsContainer.stopButton.rx.tap
.subscribe(onNext: { [weak self] in
self?.viewModel.cancelCall(stopProvider: true)
self?.viewModel.cancelCall()
self?.removeFromScreen()
})
.disposed(by: self.disposeBag)
......
......@@ -515,18 +515,7 @@ class CallViewModel: Stateable, ViewModel {
// MARK: actions
extension CallViewModel {
func cancelCall(stopProvider: Bool) {
guard let call = self.call else {
return
}
if stopProvider {
self.callsProvider.stopCall(callUUID: call.callUUID, participant: call.paricipantHash())
call.participantsCallId.forEach { (callId) in
if let participantCall = self.callService.call(callID: callId) {
self.callsProvider.stopCall(callUUID: participantCall.callUUID, participant: participantCall.paricipantHash())
}
}
}
func cancelCall() {
self.callService
.hangUpCallOrConference(callId: rendererId)
.subscribe()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment