Add cancellable property to secureBackup/recovery coordinators

This commit is contained in:
Arnaud Ringenbach
2022-03-09 10:41:48 +01:00
parent 1c11fc7243
commit 4c5ae7e4da
21 changed files with 93 additions and 43 deletions
@@ -28,6 +28,7 @@ final class KeyVerificationSelfVerifyWaitCoordinator: KeyVerificationSelfVerifyW
private let session: MXSession
private var keyVerificationSelfVerifyWaitViewModel: KeyVerificationSelfVerifyWaitViewModelType
private let keyVerificationSelfVerifyWaitViewController: KeyVerificationSelfVerifyWaitViewController
private let cancellable: Bool
// MARK: Public
@@ -38,13 +39,14 @@ final class KeyVerificationSelfVerifyWaitCoordinator: KeyVerificationSelfVerifyW
// MARK: - Setup
init(session: MXSession, isNewSignIn: Bool) {
init(session: MXSession, isNewSignIn: Bool, cancellable: Bool) {
self.session = session
let keyVerificationSelfVerifyWaitViewModel = KeyVerificationSelfVerifyWaitViewModel(session: self.session, isNewSignIn: isNewSignIn)
let keyVerificationSelfVerifyWaitViewController = KeyVerificationSelfVerifyWaitViewController.instantiate(with: keyVerificationSelfVerifyWaitViewModel)
let keyVerificationSelfVerifyWaitViewController = KeyVerificationSelfVerifyWaitViewController.instantiate(with: keyVerificationSelfVerifyWaitViewModel, cancellable: cancellable)
self.keyVerificationSelfVerifyWaitViewModel = keyVerificationSelfVerifyWaitViewModel
self.keyVerificationSelfVerifyWaitViewController = keyVerificationSelfVerifyWaitViewController
self.cancellable = cancellable
}
// MARK: - Public methods
@@ -55,6 +57,7 @@ final class KeyVerificationSelfVerifyWaitCoordinator: KeyVerificationSelfVerifyW
func toPresentable() -> UIViewController {
return self.keyVerificationSelfVerifyWaitViewController
.vc_setModalFullScreen(!self.cancellable)
}
}
@@ -56,7 +56,7 @@ final class KeyVerificationSelfVerifyWaitViewController: UIViewController {
// MARK: - Setup
class func instantiate(with viewModel: KeyVerificationSelfVerifyWaitViewModelType, cancellable: Bool = true) -> KeyVerificationSelfVerifyWaitViewController {
class func instantiate(with viewModel: KeyVerificationSelfVerifyWaitViewModelType, cancellable: Bool) -> KeyVerificationSelfVerifyWaitViewController {
let viewController = StoryboardScene.KeyVerificationSelfVerifyWaitViewController.initialScene.instantiate()
viewController.viewModel = viewModel
viewController.cancellable = cancellable