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 ...@@ -241,13 +241,13 @@ class CallViewController: UIViewController, StoryboardBased, ViewModelBased, Con
self.buttonsContainer.viewModel = self.viewModel.containerViewModel self.buttonsContainer.viewModel = self.viewModel.containerViewModel
self.buttonsContainer.cancelButton.rx.tap self.buttonsContainer.cancelButton.rx.tap
.subscribe(onNext: { [weak self] in .subscribe(onNext: { [weak self] in
self?.viewModel.cancelCall(stopProvider: true) self?.viewModel.cancelCall()
self?.removeFromScreen() self?.removeFromScreen()
}) })
.disposed(by: self.disposeBag) .disposed(by: self.disposeBag)
self.buttonsContainer.stopButton.rx.tap self.buttonsContainer.stopButton.rx.tap
.subscribe(onNext: { [weak self] in .subscribe(onNext: { [weak self] in
self?.viewModel.cancelCall(stopProvider: true) self?.viewModel.cancelCall()
self?.removeFromScreen() self?.removeFromScreen()
}) })
.disposed(by: self.disposeBag) .disposed(by: self.disposeBag)
......
...@@ -515,18 +515,7 @@ class CallViewModel: Stateable, ViewModel { ...@@ -515,18 +515,7 @@ class CallViewModel: Stateable, ViewModel {
// MARK: actions // MARK: actions
extension CallViewModel { extension CallViewModel {
func cancelCall(stopProvider: Bool) { func cancelCall() {
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())
}
}
}
self.callService self.callService
.hangUpCallOrConference(callId: rendererId) .hangUpCallOrConference(callId: rendererId)
.subscribe() .subscribe()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment