mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 10:33:45 +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:
@@ -68,6 +68,15 @@ final class AppHooks: AppHooksProtocol {
|
||||
func registerDeveloperOptionsScreenHook(_ hook: DeveloperOptionsScreenHookProtocol) {
|
||||
_developerOptionsScreenHook.withLock { $0 = hook }
|
||||
}
|
||||
|
||||
private let _recoveryKeyScreenHook: Mutex<RecoveryKeyScreenHookProtocol> = Mutex(DefaultRecoveryKeyScreenHook())
|
||||
var recoveryKeyScreenHook: RecoveryKeyScreenHookProtocol {
|
||||
_recoveryKeyScreenHook.withLock { $0 }
|
||||
}
|
||||
|
||||
func registerRecoveryKeyScreenHook(_ hook: RecoveryKeyScreenHookProtocol) {
|
||||
_recoveryKeyScreenHook.withLock { $0 = hook }
|
||||
}
|
||||
#endif
|
||||
|
||||
private let _tracingHook: Mutex<TracingHookProtocol> = Mutex(DefaultTracingHook())
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// Copyright 2026 Element Creations Ltd.
|
||||
//
|
||||
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial.
|
||||
// Please see LICENSE files in the repository root for full details.
|
||||
//
|
||||
|
||||
import Combine
|
||||
import SwiftUI
|
||||
|
||||
@MainActor protocol SecureBackupRecoveryKeyCoordinatorProtocol: CoordinatorProtocol {
|
||||
var actions: AnyPublisher<SecureBackupRecoveryKeyScreenCoordinatorAction, Never> { get }
|
||||
}
|
||||
|
||||
protocol RecoveryKeyScreenHookProtocol {
|
||||
@MainActor func makeCoordinator(parameters: SecureBackupRecoveryKeyScreenCoordinatorParameters, homeserver: String) -> any SecureBackupRecoveryKeyCoordinatorProtocol
|
||||
}
|
||||
|
||||
struct DefaultRecoveryKeyScreenHook: RecoveryKeyScreenHookProtocol {
|
||||
@MainActor func makeCoordinator(parameters: SecureBackupRecoveryKeyScreenCoordinatorParameters, homeserver: String) -> any SecureBackupRecoveryKeyCoordinatorProtocol {
|
||||
SecureBackupRecoveryKeyScreenCoordinator(parameters: parameters)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user