mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
Fix paused call view
This commit is contained in:
parent
d17a9bbe4c
commit
d170e1e52e
2 changed files with 14 additions and 2 deletions
|
|
@ -36,6 +36,8 @@ struct CallView: View {
|
|||
@EnvironmentObject var callViewModel: CallViewModel
|
||||
|
||||
@State private var addParticipantsViewModel: AddParticipantsViewModel?
|
||||
|
||||
@Environment(\.scenePhase) var scenePhase
|
||||
|
||||
private var idiom: UIUserInterfaceIdiom { UIDevice.current.userInterfaceIdiom }
|
||||
@State private var orientation = UIDevice.current.orientation
|
||||
|
|
@ -227,6 +229,14 @@ struct CallView: View {
|
|||
buttonSize = 45.0
|
||||
}
|
||||
}
|
||||
.onChange(of: scenePhase) { newPhase in
|
||||
switch newPhase {
|
||||
case .active:
|
||||
callViewModel.resetCallView()
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -109,7 +109,9 @@ class CallViewModel: ObservableObject {
|
|||
}
|
||||
|
||||
coreContext.doOnCoreQueue { core in
|
||||
if core.currentCall != nil && core.currentCall!.remoteAddress != nil {
|
||||
if (core.currentCall != nil && core.currentCall!.remoteAddress != nil) || (core.calls.first != nil && core.calls.first!.state == .Paused) {
|
||||
let currentCallTmp = core.currentCall ?? core.calls.first
|
||||
|
||||
if self.callDelegate != nil {
|
||||
self.currentCall?.removeDelegate(delegate: self.callDelegate!)
|
||||
self.callDelegate = nil
|
||||
|
|
@ -122,7 +124,7 @@ class CallViewModel: ObservableObject {
|
|||
self.currentCall?.conference?.removeDelegate(delegate: self.waitingForConferenceDelegate!)
|
||||
self.waitingForConferenceDelegate = nil
|
||||
}
|
||||
self.currentCall = core.currentCall
|
||||
self.currentCall = currentCallTmp
|
||||
let callsCounterTmp = core.calls.count
|
||||
|
||||
var videoDisplayedTmp = false
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue