mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Fix a bug where the onboarding flow was dismissed by logging out. (#5481)
* Fix a bug where the onboarding flow was dismissed by logging out. * Add some tests for the available actions while we're here. --------- Co-authored-by: Stefan Ceriu <stefan.ceriu@gmail.com>
This commit is contained in:
@@ -13,7 +13,7 @@ import SwiftState
|
||||
enum OnboardingFlowCoordinatorAction {
|
||||
case requestPresentation(animated: Bool)
|
||||
case dismiss
|
||||
case logout
|
||||
case logoutConfirmed
|
||||
}
|
||||
|
||||
class OnboardingFlowCoordinator: FlowCoordinatorProtocol {
|
||||
@@ -260,8 +260,8 @@ class OnboardingFlowCoordinator: FlowCoordinatorProtocol {
|
||||
stateMachine.tryEvent(.nextSkippingIdentityConfirmed)
|
||||
case .reset:
|
||||
startEncryptionResetFlow()
|
||||
case .logout:
|
||||
actionsSubject.send(.logout)
|
||||
case .logoutConfirmed:
|
||||
actionsSubject.send(.logoutConfirmed)
|
||||
}
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
|
||||
@@ -275,8 +275,8 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol {
|
||||
navigationTabCoordinator.setFullScreenCoverCoordinator(onboardingStackCoordinator, animated: animated)
|
||||
case .dismiss:
|
||||
navigationTabCoordinator.setFullScreenCoverCoordinator(nil)
|
||||
case .logout:
|
||||
logout()
|
||||
case .logoutConfirmed:
|
||||
actionsSubject.send(.logout)
|
||||
}
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
@@ -494,7 +494,12 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol {
|
||||
}
|
||||
|
||||
guard isLastDevice else {
|
||||
logout()
|
||||
navigationRootCoordinator.alertInfo = .init(id: .init(),
|
||||
title: L10n.screenSignoutConfirmationDialogTitle,
|
||||
message: L10n.screenSignoutConfirmationDialogContent,
|
||||
primaryButton: .init(title: L10n.screenSignoutConfirmationDialogSubmit, role: .destructive) { [weak self] in
|
||||
self?.actionsSubject.send(.logout)
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
@@ -525,15 +530,6 @@ class UserSessionFlowCoordinator: FlowCoordinatorProtocol {
|
||||
presentSecureBackupLogoutConfirmationScreen()
|
||||
}
|
||||
|
||||
private func logout() {
|
||||
navigationRootCoordinator.alertInfo = .init(id: .init(),
|
||||
title: L10n.screenSignoutConfirmationDialogTitle,
|
||||
message: L10n.screenSignoutConfirmationDialogContent,
|
||||
primaryButton: .init(title: L10n.screenSignoutConfirmationDialogSubmit, role: .destructive) { [weak self] in
|
||||
self?.actionsSubject.send(.logout)
|
||||
})
|
||||
}
|
||||
|
||||
private func presentSecureBackupLogoutConfirmationScreen() {
|
||||
let coordinator = SecureBackupLogoutConfirmationScreenCoordinator(parameters: .init(secureBackupController: userSession.clientProxy.secureBackupController,
|
||||
homeserverReachabilityPublisher: userSession.clientProxy.homeserverReachabilityPublisher))
|
||||
|
||||
Reference in New Issue
Block a user