Skip to content

Commit

Permalink
Setting default empty waypoints to empty object rather than null
Browse files Browse the repository at this point in the history
  • Loading branch information
alitoshmatov committed Oct 17, 2023
1 parent 91e2120 commit a88728a
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 @@ -170,7 +170,7 @@ function DistanceRequest({transactionID, report, transaction, route, isEditingRe
const newWaypoints = {};
_.each(data, (waypoint, index) => {
const newWaypoint = lodashGet(waypoints, waypoint, {});
newWaypoints[`waypoint${index}`] = lodashIsEmpty(newWaypoint) ? null : newWaypoint;
newWaypoints[`waypoint${index}`] = lodashIsEmpty(newWaypoint) ? {} : 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 @@ -32,8 +32,8 @@ function createInitialWaypoints(transactionID: string) {
Onyx.merge(`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`, {
comment: {
waypoints: {
waypoint0: null,
waypoint1: null,
waypoint0: {},
waypoint1: {},
},
},
});
Expand Down

0 comments on commit a88728a

Please sign in to comment.