diff --git a/client/components/GameProvider.tsx b/client/components/GameProvider.tsx index dcb5938..56e3b12 100644 --- a/client/components/GameProvider.tsx +++ b/client/components/GameProvider.tsx @@ -57,6 +57,7 @@ export default function GameProvider({ children }: { children: ReactNode }) { headers: { "Authorization": `Bearer ${auth.token}` }} ).then(resp => resp.json()), enabled: isAuthValid(auth) && !!game.playerId, + initialData: { data: [], meta: { currentPage: 0, lastPage: 0, nextPage: 0, prevPage: 0, total: 0, totalPerPage: 0 } }, refetchInterval: 5000, }) useEffect(() => { @@ -70,6 +71,7 @@ export default function GameProvider({ children }: { children: ReactNode }) { headers: { "Authorization": `Bearer ${auth.token}` }} ).then(resp => resp.json()), enabled: isAuthValid(auth), + initialData: { data: [], meta: { currentPage: 0, lastPage: 0, nextPage: 0, prevPage: 0, total: 0, totalPerPage: 0 } }, refetchInterval: 5000, }) useEffect(() => { diff --git a/client/components/GeolocationProvider.tsx b/client/components/GeolocationProvider.tsx index 6e42c5c..f855beb 100644 --- a/client/components/GeolocationProvider.tsx +++ b/client/components/GeolocationProvider.tsx @@ -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}