diff --git a/ElementX/Sources/FlowCoordinators/OnboardingFlowCoordinator.swift b/ElementX/Sources/FlowCoordinators/OnboardingFlowCoordinator.swift index 51b38350b..3e59558a9 100644 --- a/ElementX/Sources/FlowCoordinators/OnboardingFlowCoordinator.swift +++ b/ElementX/Sources/FlowCoordinators/OnboardingFlowCoordinator.swift @@ -209,6 +209,9 @@ class OnboardingFlowCoordinator: FlowCoordinatorProtocol { } case .recoveryKey: presentRecoveryKeyScreen() + case .skip: + appSettings.hasRunIdentityConfirmationOnboarding = true + stateMachine.tryEvent(.next) } } .store(in: &cancellables) diff --git a/ElementX/Sources/Screens/Onboarding/IdentityConfirmationScreen/IdentityConfirmationScreenCoordinator.swift b/ElementX/Sources/Screens/Onboarding/IdentityConfirmationScreen/IdentityConfirmationScreenCoordinator.swift index 3e953e9a3..9b600cecb 100644 --- a/ElementX/Sources/Screens/Onboarding/IdentityConfirmationScreen/IdentityConfirmationScreenCoordinator.swift +++ b/ElementX/Sources/Screens/Onboarding/IdentityConfirmationScreen/IdentityConfirmationScreenCoordinator.swift @@ -28,6 +28,8 @@ struct IdentityConfirmationScreenCoordinatorParameters { enum IdentityConfirmationScreenCoordinatorAction { case otherDevice case recoveryKey + /// Only possible in debug builds. + case skip } final class IdentityConfirmationScreenCoordinator: CoordinatorProtocol { @@ -59,6 +61,8 @@ final class IdentityConfirmationScreenCoordinator: CoordinatorProtocol { actionsSubject.send(.otherDevice) case .recoveryKey: actionsSubject.send(.recoveryKey) + case .skip: + actionsSubject.send(.skip) } } .store(in: &cancellables) diff --git a/ElementX/Sources/Screens/Onboarding/IdentityConfirmationScreen/IdentityConfirmationScreenModels.swift b/ElementX/Sources/Screens/Onboarding/IdentityConfirmationScreen/IdentityConfirmationScreenModels.swift index e358b78c1..e2ca810d6 100644 --- a/ElementX/Sources/Screens/Onboarding/IdentityConfirmationScreen/IdentityConfirmationScreenModels.swift +++ b/ElementX/Sources/Screens/Onboarding/IdentityConfirmationScreen/IdentityConfirmationScreenModels.swift @@ -19,6 +19,8 @@ import Foundation enum IdentityConfirmationScreenViewModelAction { case otherDevice case recoveryKey + /// Only possible in debug builds. + case skip } struct IdentityConfirmationScreenViewState: BindableState { @@ -34,4 +36,6 @@ struct IdentityConfirmationScreenViewState: BindableState { enum IdentityConfirmationScreenViewAction { case otherDevice case recoveryKey + /// Only possible in debug builds. + case skip } diff --git a/ElementX/Sources/Screens/Onboarding/IdentityConfirmationScreen/IdentityConfirmationScreenViewModel.swift b/ElementX/Sources/Screens/Onboarding/IdentityConfirmationScreen/IdentityConfirmationScreenViewModel.swift index 0cdf8f799..fec622ede 100644 --- a/ElementX/Sources/Screens/Onboarding/IdentityConfirmationScreen/IdentityConfirmationScreenViewModel.swift +++ b/ElementX/Sources/Screens/Onboarding/IdentityConfirmationScreen/IdentityConfirmationScreenViewModel.swift @@ -57,6 +57,8 @@ class IdentityConfirmationScreenViewModel: IdentityConfirmationScreenViewModelTy actionsSubject.send(.otherDevice) case .recoveryKey: actionsSubject.send(.recoveryKey) + case .skip: + actionsSubject.send(.skip) } } diff --git a/ElementX/Sources/Screens/Onboarding/IdentityConfirmationScreen/View/IdentityConfirmationScreen.swift b/ElementX/Sources/Screens/Onboarding/IdentityConfirmationScreen/View/IdentityConfirmationScreen.swift index d4dc6a0cb..1f677f32b 100644 --- a/ElementX/Sources/Screens/Onboarding/IdentityConfirmationScreen/View/IdentityConfirmationScreen.swift +++ b/ElementX/Sources/Screens/Onboarding/IdentityConfirmationScreen/View/IdentityConfirmationScreen.swift @@ -20,6 +20,14 @@ import SwiftUI struct IdentityConfirmationScreen: View { @ObservedObject var context: IdentityConfirmationScreenViewModel.Context + var shouldShowSkipButton: Bool { + #if DEBUG + !ProcessInfo.isRunningTests + #else + false + #endif + } + var body: some View { FullscreenDialog(topPadding: UIConstants.startScreenBreakerScreenTopPadding) { screenHeader @@ -81,6 +89,13 @@ struct IdentityConfirmationScreen: View { } .buttonStyle(.compound(.plain)) } + + if shouldShowSkipButton { + Button(L10n.actionSkip) { + context.send(viewAction: .skip) + } + .buttonStyle(.compound(.plain)) + } } } }