mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Key backup Rust API adoption (#1952)
* Adopt Rust side secure backup APIs (incomplete, based on poljar/backup-pr) * Implement the home screen recovery key confirmation banner. * Update with the latest Rust changes. The loading button for .unknown was incorrect. It should be treated as disabled. --------- Co-authored-by: Doug <douglase@element.io>
This commit is contained in:
@@ -64,7 +64,7 @@ class SettingsFlowCoordinator: FlowCoordinatorProtocol {
|
||||
|
||||
// The navigation stack doesn't like it if the root and the push happen
|
||||
// on the same loop run
|
||||
DispatchQueue.main.async {
|
||||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) {
|
||||
self.presentSecureBackupScreen(animated: animated)
|
||||
}
|
||||
default:
|
||||
|
||||
@@ -115,7 +115,7 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol {
|
||||
case .dismissedSettings:
|
||||
stateMachine.processEvent(.dismissedSettingsScreen)
|
||||
case .runLogoutFlow:
|
||||
runLogoutFlow()
|
||||
Task { await self.runLogoutFlow() }
|
||||
case .clearCache:
|
||||
actionsSubject.send(.clearCache)
|
||||
case .forceLogout:
|
||||
@@ -330,10 +330,12 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol {
|
||||
stateMachine.processEvent(.feedbackScreen)
|
||||
case .presentSessionVerificationScreen:
|
||||
stateMachine.processEvent(.showSessionVerificationScreen)
|
||||
case .presentSecureBackupSettings:
|
||||
settingsFlowCoordinator.handleAppRoute(.chatBackupSettings, animated: true)
|
||||
case .presentStartChatScreen:
|
||||
stateMachine.processEvent(.showStartChatScreen)
|
||||
case .logout:
|
||||
runLogoutFlow()
|
||||
Task { await self.runLogoutFlow() }
|
||||
case .presentInvitesScreen:
|
||||
stateMachine.processEvent(.showInvitesScreen)
|
||||
}
|
||||
@@ -358,10 +360,15 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol {
|
||||
}
|
||||
}
|
||||
|
||||
private func runLogoutFlow() {
|
||||
private func runLogoutFlow() async {
|
||||
let secureBackupController = userSession.clientProxy.secureBackupController
|
||||
|
||||
guard secureBackupController.isLastSession, appSettings.chatBackupEnabled else {
|
||||
guard case let .success(isLastSession) = await secureBackupController.isLastSession() else {
|
||||
ServiceLocator.shared.userIndicatorController.alertInfo = .init(id: .init())
|
||||
return
|
||||
}
|
||||
|
||||
guard isLastSession, appSettings.chatBackupEnabled else {
|
||||
ServiceLocator.shared.userIndicatorController.alertInfo = .init(id: .init(),
|
||||
title: L10n.screenSignoutRecoveryDisabledTitle,
|
||||
message: L10n.screenSignoutRecoveryDisabledSubtitle,
|
||||
|
||||
Reference in New Issue
Block a user