[AAv2] Improve minimum age handling (#9650)
* Improve miminum age handling * Update api sdk * Fix bad import
This commit is contained in:
@@ -46,7 +46,8 @@ const useForegroundPermissions = createPermissionHook({
|
||||
})
|
||||
|
||||
export async function getDeviceGeolocation(): Promise<Geolocation> {
|
||||
if (debug.enabled) return debug.resolve(debug.deviceGeolocation)
|
||||
if (debug.enabled && debug.deviceGeolocation)
|
||||
return debug.resolve(debug.deviceGeolocation)
|
||||
|
||||
try {
|
||||
const geocode = await Location.getCurrentPositionAsync()
|
||||
@@ -142,3 +143,8 @@ export function useSyncDeviceGeolocationOnStartup(
|
||||
})
|
||||
}, [status, sync])
|
||||
}
|
||||
|
||||
export function useIsDeviceGeolocationGranted() {
|
||||
const [status] = useForegroundPermissions()
|
||||
return status?.granted === true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user