Don't require verification on debug builds. (#2596)

* Don't require verification on debug builds.

* Add a skip button in debug builds instead.

* Fix preview tests.
This commit is contained in:
Doug
2024-03-22 10:31:32 +00:00
committed by GitHub
parent 562e5e739d
commit b711beba50
5 changed files with 28 additions and 0 deletions
@@ -209,6 +209,9 @@ class OnboardingFlowCoordinator: FlowCoordinatorProtocol {
} }
case .recoveryKey: case .recoveryKey:
presentRecoveryKeyScreen() presentRecoveryKeyScreen()
case .skip:
appSettings.hasRunIdentityConfirmationOnboarding = true
stateMachine.tryEvent(.next)
} }
} }
.store(in: &cancellables) .store(in: &cancellables)
@@ -28,6 +28,8 @@ struct IdentityConfirmationScreenCoordinatorParameters {
enum IdentityConfirmationScreenCoordinatorAction { enum IdentityConfirmationScreenCoordinatorAction {
case otherDevice case otherDevice
case recoveryKey case recoveryKey
/// Only possible in debug builds.
case skip
} }
final class IdentityConfirmationScreenCoordinator: CoordinatorProtocol { final class IdentityConfirmationScreenCoordinator: CoordinatorProtocol {
@@ -59,6 +61,8 @@ final class IdentityConfirmationScreenCoordinator: CoordinatorProtocol {
actionsSubject.send(.otherDevice) actionsSubject.send(.otherDevice)
case .recoveryKey: case .recoveryKey:
actionsSubject.send(.recoveryKey) actionsSubject.send(.recoveryKey)
case .skip:
actionsSubject.send(.skip)
} }
} }
.store(in: &cancellables) .store(in: &cancellables)
@@ -19,6 +19,8 @@ import Foundation
enum IdentityConfirmationScreenViewModelAction { enum IdentityConfirmationScreenViewModelAction {
case otherDevice case otherDevice
case recoveryKey case recoveryKey
/// Only possible in debug builds.
case skip
} }
struct IdentityConfirmationScreenViewState: BindableState { struct IdentityConfirmationScreenViewState: BindableState {
@@ -34,4 +36,6 @@ struct IdentityConfirmationScreenViewState: BindableState {
enum IdentityConfirmationScreenViewAction { enum IdentityConfirmationScreenViewAction {
case otherDevice case otherDevice
case recoveryKey case recoveryKey
/// Only possible in debug builds.
case skip
} }
@@ -57,6 +57,8 @@ class IdentityConfirmationScreenViewModel: IdentityConfirmationScreenViewModelTy
actionsSubject.send(.otherDevice) actionsSubject.send(.otherDevice)
case .recoveryKey: case .recoveryKey:
actionsSubject.send(.recoveryKey) actionsSubject.send(.recoveryKey)
case .skip:
actionsSubject.send(.skip)
} }
} }
@@ -20,6 +20,14 @@ import SwiftUI
struct IdentityConfirmationScreen: View { struct IdentityConfirmationScreen: View {
@ObservedObject var context: IdentityConfirmationScreenViewModel.Context @ObservedObject var context: IdentityConfirmationScreenViewModel.Context
var shouldShowSkipButton: Bool {
#if DEBUG
!ProcessInfo.isRunningTests
#else
false
#endif
}
var body: some View { var body: some View {
FullscreenDialog(topPadding: UIConstants.startScreenBreakerScreenTopPadding) { FullscreenDialog(topPadding: UIConstants.startScreenBreakerScreenTopPadding) {
screenHeader screenHeader
@@ -81,6 +89,13 @@ struct IdentityConfirmationScreen: View {
} }
.buttonStyle(.compound(.plain)) .buttonStyle(.compound(.plain))
} }
if shouldShowSkipButton {
Button(L10n.actionSkip) {
context.send(viewAction: .skip)
}
.buttonStyle(.compound(.plain))
}
} }
} }
} }