minor refactor on answering call logic
This commit is contained in:
parent
02d0499618
commit
925bc8538c
|
@ -23,13 +23,14 @@ extension SessionCallManager: CXProviderDelegate {
|
|||
} else {
|
||||
guard let presentingVC = CurrentAppContext().frontmostViewController() else { preconditionFailure() } // TODO: Handle more gracefully
|
||||
let callVC = CallVC(for: self.currentCall!)
|
||||
callVC.shouldAnswer = true
|
||||
if let conversationVC = presentingVC as? ConversationVC {
|
||||
callVC.conversationVC = conversationVC
|
||||
conversationVC.inputAccessoryView?.isHidden = true
|
||||
conversationVC.inputAccessoryView?.alpha = 0
|
||||
}
|
||||
presentingVC.present(callVC, animated: true, completion: nil)
|
||||
presentingVC.present(callVC, animated: true) {
|
||||
call.answerSessionCall()
|
||||
}
|
||||
}
|
||||
action.fulfill()
|
||||
} else {
|
||||
|
|
|
@ -6,7 +6,6 @@ import UIKit
|
|||
|
||||
final class CallVC : UIViewController, VideoPreviewDelegate {
|
||||
let call: SessionCall
|
||||
var shouldAnswer = false
|
||||
var shouldRestartCamera = true
|
||||
weak var conversationVC: ConversationVC? = nil
|
||||
|
||||
|
@ -218,7 +217,6 @@ final class CallVC : UIViewController, VideoPreviewDelegate {
|
|||
}
|
||||
}
|
||||
}
|
||||
if shouldAnswer { answerCall() }
|
||||
}
|
||||
|
||||
func setUpViewHierarchy() {
|
||||
|
|
|
@ -153,13 +153,14 @@ final class IncomingCallBanner: UIView, UIGestureRecognizerDelegate {
|
|||
dismiss()
|
||||
guard let presentingVC = CurrentAppContext().frontmostViewController() else { preconditionFailure() } // TODO: Handle more gracefully
|
||||
let callVC = CallVC(for: self.call)
|
||||
callVC.shouldAnswer = answer
|
||||
if let conversationVC = presentingVC as? ConversationVC {
|
||||
callVC.conversationVC = conversationVC
|
||||
conversationVC.inputAccessoryView?.isHidden = true
|
||||
conversationVC.inputAccessoryView?.alpha = 0
|
||||
}
|
||||
presentingVC.present(callVC, animated: true, completion: nil)
|
||||
presentingVC.present(callVC, animated: true) {
|
||||
if answer { self.call.answerSessionCall() }
|
||||
}
|
||||
}
|
||||
|
||||
public func show() {
|
||||
|
|
Loading…
Reference in New Issue