Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filter out your location from recent waypoints #46000

Merged
merged 1 commit into from
Jul 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions src/pages/iou/request/step/IOURequestStepWaypoint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -257,16 +257,18 @@ export default withWritableReportOrNotFound(
// Only grab the most recent 20 waypoints because that's all that is shown in the UI. This also puts them into the format of data
// that the google autocomplete component expects for it's "predefined places" feature.
selector: (waypoints) =>
(waypoints ? waypoints.slice(0, CONST.RECENT_WAYPOINTS_NUMBER as number) : []).map((waypoint) => ({
name: waypoint.name,
description: waypoint.address ?? '',
geometry: {
location: {
lat: waypoint.lat ?? 0,
lng: waypoint.lng ?? 0,
(waypoints ? waypoints.slice(0, CONST.RECENT_WAYPOINTS_NUMBER as number) : [])
.filter((waypoint) => waypoint.keyForList?.includes(CONST.YOUR_LOCATION_TEXT) !== true)
.map((waypoint) => ({
name: waypoint.name,
description: waypoint.address ?? '',
geometry: {
location: {
lat: waypoint.lat ?? 0,
lng: waypoint.lng ?? 0,
},
},
},
})),
})),
},
})(IOURequestStepWaypoint),
),
Expand Down
Loading