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
@@ -24,6 +24,7 @@ final class SecretsRecoveryWithPassphraseCoordinator: SecretsRecoveryWithPassphr
private let secretsRecoveryWithPassphraseViewController: SecretsRecoveryWithPassphraseViewController
private var secretsRecoveryWithPassphraseViewModel: SecretsRecoveryWithPassphraseViewModelType
private let cancellable: Bool
// MARK: Public
@@ -33,11 +34,12 @@ final class SecretsRecoveryWithPassphraseCoordinator: SecretsRecoveryWithPassphr
// MARK: - Setup
init(recoveryService: MXRecoveryService, recoveryGoal: SecretsRecoveryGoal) {
init(recoveryService: MXRecoveryService, recoveryGoal: SecretsRecoveryGoal, cancellable: Bool) {
let secretsRecoveryWithPassphraseViewModel = SecretsRecoveryWithPassphraseViewModel(recoveryService: recoveryService, recoveryGoal: recoveryGoal)
let secretsRecoveryWithPassphraseViewController = SecretsRecoveryWithPassphraseViewController.instantiate(with: secretsRecoveryWithPassphraseViewModel)
let secretsRecoveryWithPassphraseViewController = SecretsRecoveryWithPassphraseViewController.instantiate(with: secretsRecoveryWithPassphraseViewModel, cancellable: cancellable)
self.secretsRecoveryWithPassphraseViewController = secretsRecoveryWithPassphraseViewController
self.secretsRecoveryWithPassphraseViewModel = secretsRecoveryWithPassphraseViewModel
self.cancellable = cancellable
}
// MARK: - Public
@@ -48,6 +50,7 @@ final class SecretsRecoveryWithPassphraseCoordinator: SecretsRecoveryWithPassphr
func toPresentable() -> UIViewController {
return self.secretsRecoveryWithPassphraseViewController
.vc_setModalFullScreen(!self.cancellable)
}
}
@@ -53,7 +53,7 @@ final class SecretsRecoveryWithPassphraseViewController: UIViewController {
// MARK: - Setup
class func instantiate(with viewModel: SecretsRecoveryWithPassphraseViewModelType, cancellable: Bool = true) -> SecretsRecoveryWithPassphraseViewController {
class func instantiate(with viewModel: SecretsRecoveryWithPassphraseViewModelType, cancellable: Bool) -> SecretsRecoveryWithPassphraseViewController {
let viewController = StoryboardScene.SecretsRecoveryWithPassphraseViewController.initialScene.instantiate()
viewController.viewModel = viewModel
viewController.cancellable = cancellable