From bbc8c8cb26e17e23be9a6e4731795219883f99b2 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Thu, 2 Jul 2026 14:35:35 -0500 Subject: [PATCH] Guard location sentence on resolved name, document deviceSignalsFailed scope createGeolocationString intentionally returns undefined when the country code can't be resolved to a display name, but the NoAccessScreen location sentence only guarded on the config region, rendering "we think you're in ." with an empty hole. Guard on the string itself, matching the account card's RegionNotice. Also document that deviceSignalsFailed is in-memory and per-hook-instance by design: a soft "don't immediately re-offer" signal, not a persisted judgment about device capability. Co-Authored-By: Claude Opus 4.8 --- src/ageAssurance/components/NoAccessScreen.tsx | 2 +- src/ageAssurance/useVerificationFlow.ts | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ageAssurance/components/NoAccessScreen.tsx b/src/ageAssurance/components/NoAccessScreen.tsx index a0594cc64b..a2a2c8508e 100644 --- a/src/ageAssurance/components/NoAccessScreen.tsx +++ b/src/ageAssurance/components/NoAccessScreen.tsx @@ -178,7 +178,7 @@ export function NoAccessScreen() { - {region && ( + {region && geolocationString && ( {isUsingGPS ? ( diff --git a/src/ageAssurance/useVerificationFlow.ts b/src/ageAssurance/useVerificationFlow.ts index aab85dd620..247da65b0c 100644 --- a/src/ageAssurance/useVerificationFlow.ts +++ b/src/ageAssurance/useVerificationFlow.ts @@ -48,6 +48,13 @@ export function useAgeAssuranceVerificationFlow({ const allowsDeviceVerification = region && aa.flags.allowsDeviceVerification const [isVerifying, setIsVerifying] = useState(false) + /* + * In-memory only, and scoped to this hook instance: each surface using this + * hook tracks its own failure, and a remount (or another surface) starts + * fresh and will offer the device flow again. That's intentional for now - + * it's a soft "don't immediately re-offer" signal, not a persisted judgment + * that the device can't provide signals. + */ const [deviceSignalsFailed, setDeviceSignalsFailed] = useState(false) const verifyCta =