mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-06 12:28:29 +00:00
Fixes #2470 - Allow verifiying a session through entering the recovery key
This commit is contained in:
committed by
Stefan Ceriu
parent
46f0cf45bd
commit
023e10edf2
@@ -208,7 +208,8 @@ class SettingsFlowCoordinator: FlowCoordinatorProtocol {
|
||||
fatalError("The sessionVerificationController should aways be valid at this point")
|
||||
}
|
||||
|
||||
let verificationParameters = SessionVerificationScreenCoordinatorParameters(sessionVerificationControllerProxy: sessionVerificationController)
|
||||
let verificationParameters = SessionVerificationScreenCoordinatorParameters(sessionVerificationControllerProxy: sessionVerificationController,
|
||||
recoveryState: parameters.userSession.sessionSecurityStatePublisher.value.recoveryState)
|
||||
let coordinator = SessionVerificationScreenCoordinator(parameters: verificationParameters)
|
||||
|
||||
coordinator.actions
|
||||
@@ -216,6 +217,9 @@ class SettingsFlowCoordinator: FlowCoordinatorProtocol {
|
||||
guard let self else { return }
|
||||
|
||||
switch action {
|
||||
case .recoveryKey:
|
||||
navigationStackCoordinator.setSheetCoordinator(nil)
|
||||
handleAppRoute(.chatBackupSettings, animated: true)
|
||||
case .done:
|
||||
navigationStackCoordinator.setSheetCoordinator(nil)
|
||||
}
|
||||
|
||||
@@ -270,7 +270,7 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol {
|
||||
break
|
||||
|
||||
case (.roomList, .showLogoutConfirmationScreen, .logoutConfirmationScreen):
|
||||
presentSecureBackupConfirmationScreen()
|
||||
presentSecureBackupLogoutConfirmationScreen()
|
||||
case (.logoutConfirmationScreen, .dismissedLogoutConfirmationScreen, .roomList):
|
||||
break
|
||||
|
||||
@@ -400,7 +400,7 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol {
|
||||
return
|
||||
}
|
||||
|
||||
presentSecureBackupConfirmationScreen()
|
||||
presentSecureBackupLogoutConfirmationScreen()
|
||||
}
|
||||
|
||||
// MARK: Session verification
|
||||
@@ -410,7 +410,8 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol {
|
||||
fatalError("The sessionVerificationController should aways be valid at this point")
|
||||
}
|
||||
|
||||
let parameters = SessionVerificationScreenCoordinatorParameters(sessionVerificationControllerProxy: sessionVerificationController)
|
||||
let parameters = SessionVerificationScreenCoordinatorParameters(sessionVerificationControllerProxy: sessionVerificationController,
|
||||
recoveryState: userSession.sessionSecurityStatePublisher.value.recoveryState)
|
||||
|
||||
let coordinator = SessionVerificationScreenCoordinator(parameters: parameters)
|
||||
|
||||
@@ -419,6 +420,8 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol {
|
||||
guard let self else { return }
|
||||
|
||||
switch action {
|
||||
case .recoveryKey:
|
||||
settingsFlowCoordinator.handleAppRoute(.chatBackupSettings, animated: true)
|
||||
case .done:
|
||||
navigationSplitCoordinator.setSheetCoordinator(nil)
|
||||
}
|
||||
@@ -511,7 +514,7 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol {
|
||||
|
||||
// MARK: Secure backup confirmation
|
||||
|
||||
private func presentSecureBackupConfirmationScreen() {
|
||||
private func presentSecureBackupLogoutConfirmationScreen() {
|
||||
let coordinator = SecureBackupLogoutConfirmationScreenCoordinator(parameters: .init(secureBackupController: userSession.clientProxy.secureBackupController,
|
||||
networkMonitor: ServiceLocator.shared.networkMonitor))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user