mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Add a recovery key screen hook. (#5684)
update generateRecoveryKey to take a passphrase option Wire up AppHooks with recovery key hook Update xcodeproj Review fixups Review fixups Make the `SecureBackupRecoveryState.viewMode` extension private Bump the enterprise submodule
This commit is contained in:
+1
-1
@@ -19,7 +19,7 @@ enum SecureBackupRecoveryKeyScreenCoordinatorAction {
|
||||
case complete
|
||||
}
|
||||
|
||||
final class SecureBackupRecoveryKeyScreenCoordinator: CoordinatorProtocol {
|
||||
final class SecureBackupRecoveryKeyScreenCoordinator: SecureBackupRecoveryKeyCoordinatorProtocol {
|
||||
private let parameters: SecureBackupRecoveryKeyScreenCoordinatorParameters
|
||||
private var viewModel: SecureBackupRecoveryKeyScreenViewModelProtocol
|
||||
|
||||
|
||||
+2
-2
@@ -41,7 +41,7 @@ class SecureBackupRecoveryKeyScreenViewModel: SecureBackupRecoveryKeyScreenViewM
|
||||
state.isGeneratingKey = true
|
||||
|
||||
Task {
|
||||
switch await secureBackupController.generateRecoveryKey() {
|
||||
switch await secureBackupController.generateRecoveryKey(withPassphrase: nil) {
|
||||
case .success(let key):
|
||||
state.recoveryKey = key
|
||||
case .failure(let error):
|
||||
@@ -101,7 +101,7 @@ class SecureBackupRecoveryKeyScreenViewModel: SecureBackupRecoveryKeyScreenViewM
|
||||
}
|
||||
}
|
||||
|
||||
extension SecureBackupRecoveryState {
|
||||
private extension SecureBackupRecoveryState {
|
||||
var viewMode: SecureBackupRecoveryKeyScreenViewMode {
|
||||
switch self {
|
||||
case .disabled:
|
||||
|
||||
+2
-2
@@ -278,9 +278,9 @@ struct SecureBackupRecoveryKeyScreen_Previews: PreviewProvider, TestablePreview
|
||||
backupController.recoveryState = CurrentValueSubject<SecureBackupRecoveryState, Never>(recoveryState).asCurrentValuePublisher()
|
||||
|
||||
if let key {
|
||||
backupController.generateRecoveryKeyReturnValue = .success(key)
|
||||
backupController.generateRecoveryKeyWithPassphraseReturnValue = .success(key)
|
||||
} else {
|
||||
backupController.generateRecoveryKeyClosure = {
|
||||
backupController.generateRecoveryKeyWithPassphraseClosure = { _ in
|
||||
try? await Task.sleep(for: .seconds(1000))
|
||||
return .success("youshouldntseeme")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user