diff --git a/src/state/ageAssurance.tsx b/src/state/ageAssurance.tsx index 14f8f60507..fad7475a18 100644 --- a/src/state/ageAssurance.tsx +++ b/src/state/ageAssurance.tsx @@ -46,7 +46,7 @@ export function Provider({children}: {children: React.ReactNode}) { (() => ({ data: { updatedAt: undefined, - status: 'pending', + status: 'unknown', } as TempAgeAssuranceState, }))(), ) diff --git a/src/state/geolocation.tsx b/src/state/geolocation.tsx index f2f2a6cf02..4e85db3a6c 100644 --- a/src/state/geolocation.tsx +++ b/src/state/geolocation.tsx @@ -68,7 +68,9 @@ export function beginResolveGeolocation() { */ if (__DEV__) { geolocationResolution = new Promise(y => y({success: true})) - device.set(['geolocation'], DEFAULT_GEOLOCATION) + if (!device.get(['geolocation'])) { + device.set(['geolocation'], DEFAULT_GEOLOCATION) + } return } @@ -177,3 +179,17 @@ export function Provider({children}: {children: React.ReactNode}) { export function useGeolocation() { return React.useContext(context) } + +if (__DEV__) { + // @ts-ignore + window.setGeolocation = (geo: Device['geolocation']) => { + if (!geo?.countryCode || !geo?.isAgeRestrictedGeo) { + throw new Error( + `Expected {countryCode: string, isAgeRestrictedGeo: boolean}`, + ) + } + + device.set(['geolocation'], geo) + emitGeolocationUpdate(geo) + } +}