diff --git a/client/components/FreeChaseBanner.tsx b/client/components/FreeChaseBanner.tsx index a0ff488..9cbc5b8 100644 --- a/client/components/FreeChaseBanner.tsx +++ b/client/components/FreeChaseBanner.tsx @@ -40,7 +40,7 @@ export default function FreeChaseBanner() { icon={({ size }) => } style={{ backgroundColor: MD3Colors.secondary40 }}> - Vous pourrez vous mettre en chasse à {chaseFreePretty}. + Vous pourrez commencer la poursuite à {chaseFreePretty}. Temps restant : {prettyRemainingTime} diff --git a/client/components/GeolocationProvider.tsx b/client/components/GeolocationProvider.tsx index a7f4363..e62dfb4 100644 --- a/client/components/GeolocationProvider.tsx +++ b/client/components/GeolocationProvider.tsx @@ -13,8 +13,8 @@ export default function GeolocationProvider({ children }: { children: ReactNode const unqueueLocation = useUnqueueLocation() const geolocationMutation = useGeolocationMutation({ auth, - onPostSuccess: ({ data, variables: location }) => { - unqueueLocation(location) + onPostSuccess: (data) => { + unqueueLocation(data) geolocationMutation.reset() }, onError: ({ response, error }) => { console.error(response, error) } diff --git a/client/utils/features/location/locationSlice.ts b/client/utils/features/location/locationSlice.ts index c7c808d..c57ec66 100644 --- a/client/utils/features/location/locationSlice.ts +++ b/client/utils/features/location/locationSlice.ts @@ -27,7 +27,11 @@ export const locationSlice = createSlice({ } }, unqueueLocation: (state, action: PayloadAction) => { - state.queuedLocations.pop() + const sentLoc = action.payload + state.queuedLocations = state.queuedLocations + .filter(loc => new Date(loc.timestamp).getTime() !== sentLoc.timestamp + || loc.coords.latitude !== sentLoc.coords.latitude + || loc.coords.longitude !== sentLoc.coords.latitude) }, }, })