Skip to content

Commit

Permalink
concise empty waypoint
Browse files Browse the repository at this point in the history
  • Loading branch information
kosmydel committed Oct 4, 2023
1 parent 970a3b0 commit 366c222
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/DistanceRequest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function DistanceRequest({transactionID, report, transaction, route, isEditingRe
const newWaypoints = {};
_.each(data, (waypoint, index) => {
const newWaypoint = lodashGet(waypoints, waypoint, {});
newWaypoints[`waypoint${index}`] = lodashIsEmpty(newWaypoint) ? {} : newWaypoint;
newWaypoints[`waypoint${index}`] = lodashIsEmpty(newWaypoint) ? null : newWaypoint;
});

setOptimisticWaypoints(newWaypoints);
Expand Down
4 changes: 2 additions & 2 deletions src/libs/actions/Transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ function createInitialWaypoints(transactionID: string) {
Onyx.merge(`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`, {
comment: {
waypoints: {
waypoint0: {},
waypoint1: {},
waypoint0: null,
waypoint1: null,
},
},
});
Expand Down

0 comments on commit 366c222

Please sign in to comment.