merged element 1.8.10

This commit is contained in:
Arnfried Griesert
2022-05-03 12:48:01 +02:00
1235 changed files with 50869 additions and 23132 deletions

View File

@@ -40,6 +40,7 @@ final class SecureBackupSetupIntroViewController: UIViewController {
// MARK: Private
private var viewModel: SecureBackupSetupIntroViewModelType!
private var cancellable: Bool!
private var theme: Theme!
private var activityIndicatorPresenter: ActivityIndicatorPresenter!
@@ -51,9 +52,10 @@ final class SecureBackupSetupIntroViewController: UIViewController {
// MARK: - Setup
class func instantiate(with viewModel: SecureBackupSetupIntroViewModelType) -> SecureBackupSetupIntroViewController {
class func instantiate(with viewModel: SecureBackupSetupIntroViewModelType, cancellable: Bool) -> SecureBackupSetupIntroViewController {
let viewController = StoryboardScene.SecureBackupSetupIntroViewController.initialScene.instantiate()
viewController.viewModel = viewModel
viewController.cancellable = cancellable
viewController.theme = ThemeService.shared().theme
return viewController
}
@@ -87,6 +89,16 @@ final class SecureBackupSetupIntroViewController: UIViewController {
// MARK: - Private
private func setupViews() {
if self.cancellable {
let cancelBarButtonItem = MXKBarButtonItem(title: VectorL10n.cancel, style: .plain) { [weak self] in
guard let self = self else {
return
}
self.delegate?.secureBackupSetupIntroViewControllerDidCancel(self, showSkipAlert: true)
}
self.navigationItem.rightBarButtonItem = cancelBarButtonItem
}
self.title = VectorL10n.secureKeyBackupSetupIntroTitle
self.informationLabel.text = VectorL10n.secureKeyBackupSetupIntroInfo
@@ -126,14 +138,16 @@ final class SecureBackupSetupIntroViewController: UIViewController {
setupBackupMethods()
}
private func setupBackupMethods() {
let secureBackupSetupMethods = self.viewModel.homeserverEncryptionConfiguration.secureBackupSetupMethods
// Hide setup methods that are not listed
if !self.viewModel.wellKnown.isBackupMethodKeySupported() {
if !secureBackupSetupMethods.contains(.key) {
self.secureKeyCell.isHidden = true
}
if !self.viewModel.wellKnown.isBackupMethodPassphraseSupported() {
if !secureBackupSetupMethods.contains(.passphrase) {
self.securePassphraseCell.isHidden = true
}
}