Key backup returns (#1951)

* Converge on UserSessionFlowCoordinator logout confirmation

* Add logout confirmation screen strings to untranslated.

* Fix chat backup learn more URl fragment.

* Implement logout flows that check recovery and key backup for the last session

* Move logout confirmation screen strings to localazy

* Change encrypted timeline item copy to "Waiting for decryption key"

* Use different encrypted history banner based on key backup states

* Introduce a SettingsFlowCoordinator and implement navigation directly to the secure backup screen from the logout flows.

* Fix **mocked** secure backup controller flows

* Simplify encrypted history banner logic

* Address PR comments
This commit is contained in:
Stefan Ceriu
2023-10-24 18:38:41 +03:00
committed by GitHub
parent 6e5680fc36
commit 37f1a79a11
34 changed files with 806 additions and 111 deletions
@@ -32,6 +32,7 @@ enum SettingsScreenCoordinatorAction {
case dismiss
case logout
case clearCache
case secureBackup
}
final class SettingsScreenCoordinator: CoordinatorProtocol {
@@ -75,7 +76,7 @@ final class SettingsScreenCoordinator: CoordinatorProtocol {
case .sessionVerification:
presentSessionVerificationScreen()
case .secureBackup:
presentSecureBackupScreen()
actionsSubject.send(.secureBackup)
case .accountSessionsList:
presentAccountSessionsListURL()
case .notifications:
@@ -200,15 +201,6 @@ final class SettingsScreenCoordinator: CoordinatorProtocol {
}
}
private func presentSecureBackupScreen() {
let coordinator = SecureBackupScreenCoordinator(parameters: .init(appSettings: parameters.appSettings,
secureBackupController: parameters.userSession.clientProxy.secureBackupController,
navigationStackCoordinator: parameters.navigationStackCoordinator,
userIndicatorController: parameters.userIndicatorController))
parameters.navigationStackCoordinator?.push(coordinator)
}
private func presentNotificationSettings() {
let notificationParameters = NotificationSettingsScreenCoordinatorParameters(navigationStackCoordinator: parameters.navigationStackCoordinator,
userSession: parameters.userSession,
@@ -19,8 +19,6 @@ import SFSafeSymbols
import SwiftUI
struct SettingsScreen: View {
@State private var showingLogoutConfirmation = false
@ObservedObject var context: SettingsScreenViewModel.Context
var body: some View {
@@ -196,16 +194,9 @@ struct SettingsScreen: View {
ListRow(label: .default(title: L10n.screenSignoutPreferenceItem,
systemIcon: .rectanglePortraitAndArrowRight),
kind: .button {
showingLogoutConfirmation = true
context.send(viewAction: .logout)
})
.accessibilityIdentifier(A11yIdentifiers.settingsScreen.logout)
.alert(L10n.screenSignoutConfirmationDialogTitle, isPresented: $showingLogoutConfirmation) {
Button(L10n.screenSignoutConfirmationDialogSubmit, role: .destructive) {
context.send(viewAction: .logout)
}
} message: {
Text(L10n.screenSignoutConfirmationDialogContent)
}
} footer: {
VStack {
versionText