Skip to content

Commit

Permalink
Merge pull request #46000 from nyomanjyotisa/issue-45882
Browse files Browse the repository at this point in the history
filter out your location from recent waypoints
  • Loading branch information
Gonals authored Jul 25, 2024
2 parents b330f3a + 23dd19c commit a7d5c53
Showing 1 changed file with 11 additions and 9 deletions.
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

0 comments on commit a7d5c53

Please sign in to comment.