Fixes #2470 - Allow verifiying a session through entering the recovery key

This commit is contained in:
Stefan Ceriu
2024-02-19 10:10:25 +02:00
committed by Stefan Ceriu
parent 46f0cf45bd
commit 023e10edf2
17 changed files with 73 additions and 32 deletions
@@ -31,12 +31,13 @@ class SessionVerificationScreenViewModel: SessionVerificationViewModelType, Sess
}
init(sessionVerificationControllerProxy: SessionVerificationControllerProxyProtocol,
initialState: SessionVerificationScreenViewState = SessionVerificationScreenViewState()) {
recoveryState: SecureBackupRecoveryState,
verificationState: SessionVerificationScreenStateMachine.State = .initial) {
self.sessionVerificationControllerProxy = sessionVerificationControllerProxy
stateMachine = SessionVerificationScreenStateMachine()
super.init(initialViewState: initialState)
super.init(initialViewState: .init(showRecoveryOption: recoveryState == .incomplete, verificationState: verificationState))
setupStateMachine()
@@ -70,6 +71,8 @@ class SessionVerificationScreenViewModel: SessionVerificationViewModelType, Sess
override func process(viewAction: SessionVerificationScreenViewAction) {
switch viewAction {
case .recoveryKey:
actionsSubject.send(.recoveryKey)
case .requestVerification:
stateMachine.processEvent(.requestVerification)
case .startSasVerification: