mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-22 09:32:52 +02:00
Display only available secure backup methods on setup
This commit is contained in:
@@ -123,6 +123,21 @@ final class SecureBackupSetupIntroViewController: UIViewController {
|
||||
}
|
||||
self.delegate?.secureBackupSetupIntroViewControllerDidTapUsePassphrase(self)
|
||||
}
|
||||
|
||||
setupBackupMethods()
|
||||
}
|
||||
|
||||
private func setupBackupMethods() {
|
||||
let secureBackupSetupMethods = self.viewModel.homeserverEncryptionConfiguration.secureBackupSetupMethods
|
||||
|
||||
// Hide setup methods that are not listed
|
||||
if !secureBackupSetupMethods.contains(.key) {
|
||||
self.secureKeyCell.isHidden = true
|
||||
}
|
||||
|
||||
if !secureBackupSetupMethods.contains(.passphrase) {
|
||||
self.securePassphraseCell.isHidden = true
|
||||
}
|
||||
}
|
||||
|
||||
private func renderLoading() {
|
||||
|
||||
@@ -23,11 +23,13 @@ final class SecureBackupSetupIntroViewModel: SecureBackupSetupIntroViewModelType
|
||||
// TODO: Make these properties private
|
||||
let keyBackup: MXKeyBackup?
|
||||
let checkKeyBackup: Bool
|
||||
let homeserverEncryptionConfiguration: HomeserverEncryptionConfiguration
|
||||
|
||||
// MARK: - Setup
|
||||
|
||||
init(keyBackup: MXKeyBackup?, checkKeyBackup: Bool) {
|
||||
init(keyBackup: MXKeyBackup?, checkKeyBackup: Bool, homeserverEncryptionConfiguration: HomeserverEncryptionConfiguration) {
|
||||
self.keyBackup = keyBackup
|
||||
self.checkKeyBackup = checkKeyBackup
|
||||
}
|
||||
self.homeserverEncryptionConfiguration = homeserverEncryptionConfiguration
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,4 +22,5 @@ protocol SecureBackupSetupIntroViewModelType {
|
||||
// TODO: Hide these properties from interface and use same behavior as other view models
|
||||
var keyBackup: MXKeyBackup? { get }
|
||||
var checkKeyBackup: Bool { get }
|
||||
var homeserverEncryptionConfiguration: HomeserverEncryptionConfiguration { get }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user