Prototype de récupération des dernières positions
This commit is contained in:
@ -3,6 +3,7 @@ import { useAuth } from '@/hooks/useAuth'
|
||||
import { useQueuedLocations, useUnqueueLocation } from '@/hooks/useLocation'
|
||||
import { useGeolocationMutation } from '@/hooks/mutations/useGeolocationMutation'
|
||||
import { useStartGeolocationServiceEffect } from '@/utils/geolocation'
|
||||
import { Platform } from 'react-native'
|
||||
|
||||
export default function GeolocationProvider({ children }: { children: ReactNode }) {
|
||||
useStartGeolocationServiceEffect()
|
||||
@ -20,7 +21,7 @@ export default function GeolocationProvider({ children }: { children: ReactNode
|
||||
})
|
||||
|
||||
useEffect(() => {
|
||||
if (geolocationsQueue.length === 0 || geolocationMutation.isPending)
|
||||
if (geolocationsQueue.length === 0 || geolocationMutation.isPending || Platform.OS === "web")
|
||||
return
|
||||
const locToSend = geolocationsQueue[0]
|
||||
geolocationMutation.mutate(locToSend)
|
||||
|
Reference in New Issue
Block a user