Transmission des positions seulement après connexion
This commit is contained in:
parent
0f16edd8cc
commit
25ca687448
@ -23,12 +23,14 @@ export default function GeolocationProvider({ children }: { children: ReactNode
|
|||||||
onError: ({ response, error }) => { console.error(response, error) }
|
onError: ({ response, error }) => { console.error(response, error) }
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (Platform.OS !== "web") {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (geolocationsQueue.length === 0 || geolocationMutation.isPending || Platform.OS === "web")
|
if (geolocationsQueue.length === 0 || geolocationMutation.isPending || isAuthValid(auth))
|
||||||
return
|
return
|
||||||
const locToSend = geolocationsQueue[0]
|
const locToSend = geolocationsQueue[0]
|
||||||
geolocationMutation.mutate(locToSend)
|
geolocationMutation.mutate(locToSend)
|
||||||
}, [auth, geolocationsQueue])
|
}, [auth, geolocationMutation.status, geolocationsQueue])
|
||||||
|
}
|
||||||
|
|
||||||
const lastLocationsQuery = useQuery({
|
const lastLocationsQuery = useQuery({
|
||||||
queryKey: ['get-last-locations', auth.token],
|
queryKey: ['get-last-locations', auth.token],
|
||||||
|
Loading…
Reference in New Issue
Block a user