mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 19:11:45 +00:00
Push the deactivate account screen. (#3297)
This commit is contained in:
@@ -242,8 +242,6 @@ class SettingsFlowCoordinator: FlowCoordinatorProtocol {
|
||||
}
|
||||
|
||||
private func presentDeactivateAccount() {
|
||||
let navigationCoordinator = NavigationStackCoordinator()
|
||||
|
||||
let parameters = DeactivateAccountScreenCoordinatorParameters(clientProxy: parameters.userSession.clientProxy,
|
||||
userIndicatorController: parameters.userIndicatorController)
|
||||
let coordinator = DeactivateAccountScreenCoordinator(parameters: parameters)
|
||||
@@ -253,16 +251,13 @@ class SettingsFlowCoordinator: FlowCoordinatorProtocol {
|
||||
guard let self else { return }
|
||||
|
||||
switch action {
|
||||
case .cancel:
|
||||
navigationStackCoordinator.setSheetCoordinator(nil)
|
||||
case .accountDeactivated:
|
||||
actionsSubject.send(.forceLogout)
|
||||
}
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
|
||||
navigationCoordinator.setRootCoordinator(coordinator)
|
||||
navigationStackCoordinator.setSheetCoordinator(navigationCoordinator)
|
||||
navigationStackCoordinator.push(coordinator)
|
||||
}
|
||||
|
||||
// MARK: OIDC Account Management
|
||||
|
||||
-3
@@ -14,7 +14,6 @@ struct DeactivateAccountScreenCoordinatorParameters {
|
||||
}
|
||||
|
||||
enum DeactivateAccountScreenCoordinatorAction {
|
||||
case cancel
|
||||
case accountDeactivated
|
||||
}
|
||||
|
||||
@@ -42,8 +41,6 @@ final class DeactivateAccountScreenCoordinator: CoordinatorProtocol {
|
||||
|
||||
guard let self else { return }
|
||||
switch action {
|
||||
case .cancel:
|
||||
actionsSubject.send(.cancel)
|
||||
case .accountDeactivated:
|
||||
actionsSubject.send(.accountDeactivated)
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
import Foundation
|
||||
|
||||
enum DeactivateAccountScreenViewModelAction {
|
||||
case cancel
|
||||
case accountDeactivated
|
||||
}
|
||||
|
||||
@@ -50,5 +49,4 @@ enum DeactivateAccountScreenAlert {
|
||||
|
||||
enum DeactivateAccountScreenViewAction {
|
||||
case deactivate
|
||||
case cancel
|
||||
}
|
||||
|
||||
-2
@@ -30,8 +30,6 @@ class DeactivateAccountScreenViewModel: DeactivateAccountScreenViewModelType, De
|
||||
MXLog.info("View model: received view action: \(viewAction)")
|
||||
|
||||
switch viewAction {
|
||||
case .cancel:
|
||||
actionsSubject.send(.cancel)
|
||||
case .deactivate:
|
||||
showDeactivationConfirmation()
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ struct DeactivateAccountScreen: View {
|
||||
}
|
||||
.navigationTitle(L10n.screenDeactivateAccountTitle)
|
||||
.navigationBarTitleDisplayMode(.inline)
|
||||
.toolbar { toolbar }
|
||||
.alert(item: $context.alertInfo)
|
||||
}
|
||||
|
||||
@@ -71,14 +70,6 @@ struct DeactivateAccountScreen: View {
|
||||
.compoundListSectionHeader()
|
||||
}
|
||||
}
|
||||
|
||||
private var toolbar: some ToolbarContent {
|
||||
ToolbarItem(placement: .cancellationAction) {
|
||||
Button(L10n.actionCancel) {
|
||||
context.send(viewAction: .cancel)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private struct InfoItem: View {
|
||||
|
||||
@@ -181,11 +181,12 @@ struct SettingsScreen: View {
|
||||
context.send(viewAction: .logout)
|
||||
})
|
||||
.accessibilityIdentifier(A11yIdentifiers.settingsScreen.logout)
|
||||
|
||||
if context.viewState.showAccountDeactivation {
|
||||
ListRow(label: .action(title: L10n.actionDeactivateAccount,
|
||||
icon: \.warning,
|
||||
role: .destructive),
|
||||
kind: .button {
|
||||
kind: .navigationLink {
|
||||
context.send(viewAction: .deactivateAccount)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user