mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
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:
@@ -34,7 +34,7 @@ enum HomeScreenCoordinatorAction {
|
||||
case presentSessionVerificationScreen
|
||||
case presentStartChatScreen
|
||||
case presentInvitesScreen
|
||||
case signOut
|
||||
case logout
|
||||
}
|
||||
|
||||
final class HomeScreenCoordinator: CoordinatorProtocol {
|
||||
@@ -75,8 +75,8 @@ final class HomeScreenCoordinator: CoordinatorProtocol {
|
||||
actionsSubject.send(.presentSettingsScreen)
|
||||
case .presentSessionVerificationScreen:
|
||||
actionsSubject.send(.presentSessionVerificationScreen)
|
||||
case .signOut:
|
||||
actionsSubject.send(.signOut)
|
||||
case .logout:
|
||||
actionsSubject.send(.logout)
|
||||
case .presentStartChatScreen:
|
||||
actionsSubject.send(.presentStartChatScreen)
|
||||
case .presentInvitesScreen:
|
||||
|
||||
@@ -27,13 +27,13 @@ enum HomeScreenViewModelAction {
|
||||
case presentFeedbackScreen
|
||||
case presentStartChatScreen
|
||||
case presentInvitesScreen
|
||||
case signOut
|
||||
case logout
|
||||
}
|
||||
|
||||
enum HomeScreenViewUserMenuAction {
|
||||
case settings
|
||||
case feedback
|
||||
case signOut
|
||||
case logout
|
||||
}
|
||||
|
||||
enum HomeScreenViewAction {
|
||||
|
||||
@@ -138,8 +138,8 @@ class HomeScreenViewModel: HomeScreenViewModelType, HomeScreenViewModelProtocol
|
||||
actionsSubject.send(.presentFeedbackScreen)
|
||||
case .settings:
|
||||
actionsSubject.send(.presentSettingsScreen)
|
||||
case .signOut:
|
||||
actionsSubject.send(.signOut)
|
||||
case .logout:
|
||||
actionsSubject.send(.logout)
|
||||
}
|
||||
case .verifySession:
|
||||
actionsSubject.send(.presentSessionVerificationScreen)
|
||||
|
||||
@@ -18,7 +18,6 @@ import Compound
|
||||
import SwiftUI
|
||||
|
||||
struct HomeScreenUserMenuButton: View {
|
||||
@State private var showingLogoutConfirmation = false
|
||||
@Environment(\.colorScheme) var colorScheme
|
||||
|
||||
@ObservedObject var context: HomeScreenViewModel.Context
|
||||
@@ -53,7 +52,7 @@ struct HomeScreenUserMenuButton: View {
|
||||
}
|
||||
Section {
|
||||
Button(role: .destructive) {
|
||||
showingLogoutConfirmation = true
|
||||
context.send(viewAction: .userMenu(action: .logout))
|
||||
} label: {
|
||||
Label(L10n.screenSignoutPreferenceItem, systemImage: "rectangle.portrait.and.arrow.right")
|
||||
}
|
||||
@@ -68,15 +67,6 @@ struct HomeScreenUserMenuButton: View {
|
||||
.overlayBadge(10, isBadged: context.viewState.showUserMenuBadge)
|
||||
.compositingGroup()
|
||||
}
|
||||
.alert(L10n.screenSignoutConfirmationDialogTitle,
|
||||
isPresented: $showingLogoutConfirmation) {
|
||||
Button(L10n.screenSignoutConfirmationDialogSubmit,
|
||||
role: .destructive) {
|
||||
context.send(viewAction: .userMenu(action: .signOut))
|
||||
}
|
||||
} message: {
|
||||
Text(L10n.screenSignoutConfirmationDialogContent)
|
||||
}
|
||||
.accessibilityLabel(L10n.a11yUserMenu)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user