Prototype de récupération des dernières positions

This commit is contained in:
2024-12-11 01:53:28 +01:00
parent bdd53eb8bb
commit 9176eb014f
3 changed files with 41 additions and 3 deletions

View File

@ -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)