mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Have the UserIndicatorController use a separate window, switch to using one single instance throughout the application
This commit is contained in:
committed by
Stefan Ceriu
parent
1102beb3dd
commit
4b26a798dc
+1
-1
@@ -19,7 +19,7 @@ import SwiftUI
|
||||
|
||||
struct SecureBackupRecoveryKeyScreenCoordinatorParameters {
|
||||
let secureBackupController: SecureBackupControllerProtocol
|
||||
weak var userIndicatorController: UserIndicatorControllerProtocol?
|
||||
let userIndicatorController: UserIndicatorControllerProtocol
|
||||
}
|
||||
|
||||
enum SecureBackupRecoveryKeyScreenCoordinatorAction {
|
||||
|
||||
+3
-3
@@ -21,14 +21,14 @@ typealias SecureBackupRecoveryKeyScreenViewModelType = StateStoreViewModel<Secur
|
||||
|
||||
class SecureBackupRecoveryKeyScreenViewModel: SecureBackupRecoveryKeyScreenViewModelType, SecureBackupRecoveryKeyScreenViewModelProtocol {
|
||||
private let secureBackupController: SecureBackupControllerProtocol
|
||||
private weak var userIndicatorController: UserIndicatorControllerProtocol?
|
||||
private let userIndicatorController: UserIndicatorControllerProtocol
|
||||
|
||||
private var actionsSubject: PassthroughSubject<SecureBackupRecoveryKeyScreenViewModelAction, Never> = .init()
|
||||
var actions: AnyPublisher<SecureBackupRecoveryKeyScreenViewModelAction, Never> {
|
||||
actionsSubject.eraseToAnyPublisher()
|
||||
}
|
||||
|
||||
init(secureBackupController: SecureBackupControllerProtocol, userIndicatorController: UserIndicatorControllerProtocol?) {
|
||||
init(secureBackupController: SecureBackupControllerProtocol, userIndicatorController: UserIndicatorControllerProtocol) {
|
||||
self.secureBackupController = secureBackupController
|
||||
self.userIndicatorController = userIndicatorController
|
||||
|
||||
@@ -66,7 +66,7 @@ class SecureBackupRecoveryKeyScreenViewModel: SecureBackupRecoveryKeyScreenViewM
|
||||
}
|
||||
case .copyKey:
|
||||
UIPasteboard.general.string = state.recoveryKey
|
||||
userIndicatorController?.submitIndicator(.init(title: "Copied recovery key"))
|
||||
userIndicatorController.submitIndicator(.init(title: "Copied recovery key"))
|
||||
state.doneButtonEnabled = true
|
||||
case .keySaved:
|
||||
state.doneButtonEnabled = true
|
||||
|
||||
+1
-1
@@ -228,6 +228,6 @@ struct SecureBackupRecoveryKeyScreen_Previews: PreviewProvider, TestablePreview
|
||||
let backupController = SecureBackupControllerMock()
|
||||
backupController.underlyingRecoveryKeyState = CurrentValueSubject<SecureBackupRecoveryKeyState, Never>(recoveryKeyState).asCurrentValuePublisher()
|
||||
|
||||
return SecureBackupRecoveryKeyScreenViewModel(secureBackupController: backupController, userIndicatorController: nil)
|
||||
return SecureBackupRecoveryKeyScreenViewModel(secureBackupController: backupController, userIndicatorController: UserIndicatorControllerMock())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user