mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Add support for account deactivation when not using OIDC. (#3295)
This commit is contained in:
@@ -126,6 +126,8 @@ class SettingsFlowCoordinator: FlowCoordinatorProtocol {
|
||||
presentAdvancedSettings()
|
||||
case .developerOptions:
|
||||
presentDeveloperOptions()
|
||||
case .deactivateAccount:
|
||||
presentDeactivateAccount()
|
||||
}
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
@@ -238,6 +240,30 @@ class SettingsFlowCoordinator: FlowCoordinatorProtocol {
|
||||
|
||||
navigationStackCoordinator.push(coordinator)
|
||||
}
|
||||
|
||||
private func presentDeactivateAccount() {
|
||||
let navigationCoordinator = NavigationStackCoordinator()
|
||||
|
||||
let parameters = DeactivateAccountScreenCoordinatorParameters(clientProxy: parameters.userSession.clientProxy,
|
||||
userIndicatorController: parameters.userIndicatorController)
|
||||
let coordinator = DeactivateAccountScreenCoordinator(parameters: parameters)
|
||||
|
||||
coordinator.actionsPublisher
|
||||
.sink { [weak self] action in
|
||||
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)
|
||||
}
|
||||
|
||||
// MARK: OIDC Account Management
|
||||
|
||||
|
||||
Reference in New Issue
Block a user