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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 28 additions and 0 deletions

View File

@ -209,6 +209,9 @@ class OnboardingFlowCoordinator: FlowCoordinatorProtocol {
}
case .recoveryKey:
presentRecoveryKeyScreen()
case .skip:
appSettings.hasRunIdentityConfirmationOnboarding = true
stateMachine.tryEvent(.next)
}
}
.store(in: &cancellables)

View File

@ -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)

View File

@ -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
}

View File

@ -57,6 +57,8 @@ class IdentityConfirmationScreenViewModel: IdentityConfirmationScreenViewModelTy
actionsSubject.send(.otherDevice)
case .recoveryKey:
actionsSubject.send(.recoveryKey)
case .skip:
actionsSubject.send(.skip)
}
}

View File

@ -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))
}
}
}
}