mirror of
https://github.com/element-hq/element-x-ios.git
synced 2025-03-10 21:39:12 +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:
parent
562e5e739d
commit
b711beba50
@ -209,6 +209,9 @@ class OnboardingFlowCoordinator: FlowCoordinatorProtocol {
|
||||
}
|
||||
case .recoveryKey:
|
||||
presentRecoveryKeyScreen()
|
||||
case .skip:
|
||||
appSettings.hasRunIdentityConfirmationOnboarding = true
|
||||
stateMachine.tryEvent(.next)
|
||||
}
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -57,6 +57,8 @@ class IdentityConfirmationScreenViewModel: IdentityConfirmationScreenViewModelTy
|
||||
actionsSubject.send(.otherDevice)
|
||||
case .recoveryKey:
|
||||
actionsSubject.send(.recoveryKey)
|
||||
case .skip:
|
||||
actionsSubject.send(.skip)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user