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
@@ -72,8 +72,10 @@ class LinkNewDeviceScreenViewModel: LinkNewDeviceScreenViewModelType, LinkNewDev
case .verified, .unavailable:
break
case .appLockPINRequired:
// Follow-up PR: present the App Lock PIN screen to verify the device owner.
return
guard await verifyWithAppLockPIN() else {
state.mode = .readyToLink(.idle)
return
}
case .cancelled, .unverified:
state.mode = .readyToLink(.idle)
return
@@ -92,6 +94,13 @@ class LinkNewDeviceScreenViewModel: LinkNewDeviceScreenViewModelType, LinkNewDev
}
}
/// Asks the coordinator to verify the device owner with the App Lock PIN, suspending until it has a result.
private func verifyWithAppLockPIN() async -> Bool {
await withCheckedContinuation { continuation in
actionsSubject.send(.verifyWithAppLockPIN(continuation))
}
}
private func linkMobileDevice() async {
state.mode = .readyToLink(.generatingCode)