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
@@ -54,6 +54,19 @@ struct AppLockScreen: View {
.animation(.elementDefault, value: context.viewState.forcedLogoutIndicator)
}
.alert(item: $context.alertInfo)
.toolbar { toolbar }
}
@ToolbarContentBuilder
var toolbar: some ToolbarContent {
if context.viewState.mode == .verifyDeviceOwner {
ToolbarItem(placement: .cancellationAction) {
ToolbarButton(role: .cancel) {
context.send(viewAction: .cancelVerifyDeviceOwner)
}
.accessibilityIdentifier(A11yIdentifiers.appLockScreen.cancel)
}
}
}
var header: some View {
@@ -114,10 +127,17 @@ struct AppLockScreen: View {
struct AppLockScreen_Previews: PreviewProvider, TestablePreview {
static let viewModel = AppLockScreenViewModel(appLockService: AppLockServiceMock.mock())
static let verifyViewModel = AppLockScreenViewModel(appLockService: AppLockServiceMock.mock(), mode: .verifyDeviceOwner)
static var previews: some View {
ElementNavigationStack {
AppLockScreen(context: viewModel.context)
}
.previewDisplayName("Unlock")
ElementNavigationStack {
AppLockScreen(context: verifyViewModel.context)
}
.previewDisplayName("Verify")
}
}