Stabilité téléchargement des données

This commit is contained in:
2024-12-14 00:53:22 +01:00
parent 3d50cee9a9
commit 57676abb02
2 changed files with 4 additions and 1 deletions

View File

@@ -39,13 +39,14 @@ export default function GeolocationProvider({ children }: { children: ReactNode
"Content-Type": "application/json",
},
}).then(resp => resp.json()),
initialData: [],
enabled: isAuthValid(auth),
refetchInterval: 5000,
})
useEffect(() => {
if (lastLocationsQuery.isSuccess && lastLocationsQuery.data)
setLastPlayerLocations(lastLocationsQuery.data)
}, [lastLocationsQuery.status, lastLocationsQuery.dataUpdatedAt, auth])
}, [lastLocationsQuery.status, lastLocationsQuery.dataUpdatedAt])
return <>
{children}