mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 15:45:11 +00:00
Onboarding flow coordinator and FTUE changes (#2578)
Fixes #2595, fixes #2594, fixes #2593, fixes #2592, fixes #2591
This commit is contained in:
@@ -28,12 +28,7 @@ class AppCoordinatorStateMachine {
|
||||
case softLogout
|
||||
/// Opening an existing session.
|
||||
case restoringSession
|
||||
|
||||
/// Showing the mandatory app lock setup flow before restoring the session.
|
||||
/// This state should only be allowed before restoring an existing session. For
|
||||
/// new users the setup is inserted in the middle of the authentication flow.
|
||||
case mandatoryAppLockSetup
|
||||
|
||||
|
||||
/// User session started
|
||||
case signedIn
|
||||
|
||||
@@ -48,21 +43,13 @@ class AppCoordinatorStateMachine {
|
||||
|
||||
/// Start the `AppCoordinator` by restoring an existing account.
|
||||
case startWithExistingSession
|
||||
|
||||
/// Start the `AppCoordinator` by showing the mandatory PIN creation flow.
|
||||
/// This event should only be sent if an account exists and a mandatory PIN is
|
||||
/// missing. Normally it will be handled as part of the authentication flow.
|
||||
case startWithAppLockSetup
|
||||
|
||||
/// Restoring session failed.
|
||||
case failedRestoringSession
|
||||
|
||||
/// A session has been created.
|
||||
case createdUserSession
|
||||
|
||||
/// The app lock setup has been completed.
|
||||
case appLockSetupComplete
|
||||
|
||||
|
||||
/// Request sign out.
|
||||
case signOut(isSoft: Bool, disableAppLock: Bool)
|
||||
/// Request the soft logout screen.
|
||||
@@ -92,10 +79,7 @@ class AppCoordinatorStateMachine {
|
||||
stateMachine.addRoutes(event: .startWithExistingSession, transitions: [.initial => .restoringSession])
|
||||
stateMachine.addRoutes(event: .createdUserSession, transitions: [.restoringSession => .signedIn])
|
||||
stateMachine.addRoutes(event: .failedRestoringSession, transitions: [.restoringSession => .signedOut])
|
||||
|
||||
stateMachine.addRoutes(event: .startWithAppLockSetup, transitions: [.initial => .mandatoryAppLockSetup])
|
||||
stateMachine.addRoutes(event: .appLockSetupComplete, transitions: [.mandatoryAppLockSetup => .restoringSession])
|
||||
|
||||
|
||||
stateMachine.addRoutes(event: .completedSigningOut, transitions: [.signingOut(isSoft: false, disableAppLock: false) => .signedOut,
|
||||
.signingOut(isSoft: false, disableAppLock: true) => .signedOut])
|
||||
stateMachine.addRoutes(event: .showSoftLogout, transitions: [.signingOut(isSoft: true, disableAppLock: false) => .softLogout])
|
||||
|
||||
Reference in New Issue
Block a user