Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push the deactivate account screen. #3297

Merged
merged 2 commits into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ struct DeactivateAccountScreenCoordinatorParameters {
}

enum DeactivateAccountScreenCoordinatorAction {
case cancel
case accountDeactivated
}

Expand Down Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import Foundation

enum DeactivateAccountScreenViewModelAction {
case cancel
case accountDeactivated
}

Expand Down Expand Up @@ -50,5 +49,4 @@ enum DeactivateAccountScreenAlert {

enum DeactivateAccountScreenViewAction {
case deactivate
case cancel
}
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ struct DeactivateAccountScreen: View {
}
.navigationTitle(L10n.screenDeactivateAccountTitle)
.navigationBarTitleDisplayMode(.inline)
.toolbar { toolbar }
.alert(item: $context.alertInfo)
}

Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
})
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading