Make LinkNewDeviceScreen fall back to the App Lock PIN code when there's no passcode. (#5794)

* Fall back to the AppLock PIN code when there's no passcode.

* Add extra tests on the LinkNewDeviceFlowCoordinator.

* Misc tweaks for clarification.

* Regenerate snapshots.
This commit is contained in:
Doug
2026-07-01 10:13:18 +01:00
committed by GitHub
parent 7097ceb910
commit 123661537a
38 changed files with 296 additions and 21 deletions
@@ -19,10 +19,10 @@ class AppLockScreenViewModel: AppLockScreenViewModelType, AppLockScreenViewModel
actionsSubject.eraseToAnyPublisher()
}
init(appLockService: AppLockServiceProtocol) {
init(appLockService: AppLockServiceProtocol, mode: AppLockScreenMode = .appUnlock) {
self.appLockService = appLockService
super.init(initialViewState: AppLockScreenViewState(bindings: .init()))
super.init(initialViewState: AppLockScreenViewState(mode: mode, bindings: .init()))
appLockService.numberOfPINAttempts
.weakAssign(to: \.state.numberOfPINAttempts, on: self)
@@ -51,6 +51,8 @@ class AppLockScreenViewModel: AppLockScreenViewModelType, AppLockScreenViewModel
state.bindings.pinCode = ""
case .forgotPIN:
handleForgotPIN()
case .cancelVerifyDeviceOwner:
actionsSubject.send(.cancelVerifyDeviceOwner)
}
}