Passage du délai de mise à jour des données depuis le serveur à 15 secondes

This commit is contained in:
2024-12-17 01:12:54 +01:00
parent 0433e4695e
commit 409e13277e
3 changed files with 10 additions and 7 deletions

View File

@ -8,6 +8,7 @@ import { useQuery } from '@tanstack/react-query'
import { isAuthValid } from '@/utils/features/auth/authSlice'
import { socket } from '@/utils/socket'
import { PlayerLocation } from '@/utils/features/location/locationSlice'
import { Constants } from '@/constants/Constants'
export default function GeolocationProvider({ children }: { children: ReactNode }) {
useStartGeolocationServiceEffect()
@ -43,7 +44,7 @@ export default function GeolocationProvider({ children }: { children: ReactNode
}).then(resp => resp.json()),
initialData: [],
enabled: isAuthValid(auth),
refetchInterval: 5000,
refetchInterval: Constants.QUERY_REFETCH_INTERVAL * 1000,
})
useEffect(() => {
if (lastLocationsQuery.isSuccess && lastLocationsQuery.data)