Skip to content

Commit

Permalink
Merge pull request #37099 from codinggeek2023/issue-36067
Browse files Browse the repository at this point in the history
[Fix]: Distance -When adding 'Stop' location the newly added location is added to 'Finish' location
  • Loading branch information
neil-marcellini authored Feb 28, 2024
2 parents fd16476 + f92b845 commit d7d5630
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 8 deletions.
2 changes: 0 additions & 2 deletions src/components/DistanceEReceipt.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ function DistanceEReceipt({transaction}: DistanceEReceiptProps) {
let descriptionKey: TranslationPaths = 'distance.waypointDescription.stop';
if (index === 0) {
descriptionKey = 'distance.waypointDescription.start';
} else if (index === Object.keys(waypoints).length - 1) {
descriptionKey = 'distance.waypointDescription.finish';
}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function DistanceRequestRenderItem({waypoints, item = '', onSecondaryInteraction
descriptionKey += 'start';
waypointIcon = Expensicons.DotIndicatorUnfilled;
} else if (index === lastWaypointIndex) {
descriptionKey += 'finish';
descriptionKey += 'stop';
waypointIcon = Expensicons.Location;
} else {
descriptionKey += 'stop';
Expand Down
1 change: 0 additions & 1 deletion src/languages/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2238,7 +2238,6 @@ export default {
address: 'Address',
waypointDescription: {
start: 'Start',
finish: 'Finish',
stop: 'Stop',
},
mapPending: {
Expand Down
1 change: 0 additions & 1 deletion src/languages/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2727,7 +2727,6 @@ export default {
address: 'Dirección',
waypointDescription: {
start: 'Comienzo',
finish: 'Final',
stop: 'Parada',
},
mapPending: {
Expand Down
4 changes: 1 addition & 3 deletions src/pages/iou/request/step/IOURequestStepWaypoint.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,10 @@ function IOURequestStepWaypoint({
switch (parsedWaypointIndex) {
case 0:
return 'distance.waypointDescription.start';
case waypointCount - 1:
return 'distance.waypointDescription.finish';
default:
return 'distance.waypointDescription.stop';
}
}, [parsedWaypointIndex, waypointCount]);
}, [parsedWaypointIndex]);

const locationBias = useLocationBias(allWaypoints, userLocation);
const waypointAddress = currentWaypoint.address ?? '';
Expand Down

0 comments on commit d7d5630

Please sign in to comment.