Correction envoi dernière position
This commit is contained in:
parent
1241669c35
commit
30a687018f
@ -40,7 +40,7 @@ export default function FreeChaseBanner() {
|
||||
icon={({ size }) => <FontAwesome6 name={iconName} size={size} color={MD3Colors.secondary90} />}
|
||||
style={{ backgroundColor: MD3Colors.secondary40 }}>
|
||||
<View>
|
||||
<Text variant='titleMedium'>Vous pourrez vous mettre en chasse à {chaseFreePretty}.</Text>
|
||||
<Text variant='titleMedium'>Vous pourrez commencer la poursuite à {chaseFreePretty}.</Text>
|
||||
<Text variant='titleSmall'>Temps restant : {prettyRemainingTime}</Text>
|
||||
</View>
|
||||
</Banner>
|
||||
|
@ -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) }
|
||||
|
@ -27,7 +27,11 @@ export const locationSlice = createSlice({
|
||||
}
|
||||
},
|
||||
unqueueLocation: (state, action: PayloadAction<LocationObject>) => {
|
||||
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)
|
||||
},
|
||||
},
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user