Move /platform/detection vars into /env (#9707)
* Add platform vars to env * Replace /platform/detection with /env
This commit is contained in:
@@ -3,7 +3,7 @@ import {Platform} from 'react-native'
|
||||
import * as Location from 'expo-location'
|
||||
import {createPermissionHook} from 'expo-modules-core'
|
||||
|
||||
import {isNative} from '#/platform/detection'
|
||||
import {IS_NATIVE} from '#/env'
|
||||
import * as debug from '#/geolocation/debug'
|
||||
import {logger} from '#/geolocation/logger'
|
||||
import {type Geolocation} from '#/geolocation/types'
|
||||
@@ -118,7 +118,7 @@ export function useSyncDeviceGeolocationOnStartup(
|
||||
const synced = useRef(false)
|
||||
const [status] = useForegroundPermissions()
|
||||
useEffect(() => {
|
||||
if (!isNative) return
|
||||
if (!IS_NATIVE) return
|
||||
|
||||
async function get() {
|
||||
// no need to set this more than once per session
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {type LocationGeocodedAddress} from 'expo-location'
|
||||
|
||||
import {isAndroid} from '#/platform/detection'
|
||||
import {IS_ANDROID} from '#/env'
|
||||
import {logger} from '#/geolocation/logger'
|
||||
import {type Geolocation} from '#/geolocation/types'
|
||||
|
||||
@@ -81,7 +81,7 @@ export function normalizeDeviceLocation(
|
||||
/*
|
||||
* Android doesn't give us ISO 3166-2 short codes. We need these for US
|
||||
*/
|
||||
if (isAndroid) {
|
||||
if (IS_ANDROID) {
|
||||
if (region && isoCountryCode === 'US') {
|
||||
/*
|
||||
* We need short codes for US states. If we can't remap it, just drop it
|
||||
|
||||
Reference in New Issue
Block a user