mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
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:
@@ -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)
|
||||||
|
|||||||
+4
@@ -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)
|
||||||
|
|||||||
+4
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
+2
@@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+15
@@ -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))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user