Skip to content

Commit

Permalink
updated comment
Browse files Browse the repository at this point in the history
  • Loading branch information
FitseTLT committed Dec 9, 2024
1 parent 8c1fc5e commit 641ea6b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3230,10 +3230,10 @@ function updateMoneyRequestDistance({

if (transactionBackup) {
const transaction = allTransactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`];
// We need to have all the keys of the original waypoint in the failure data for onyx merge to properly reset
// waypoints keys that do not exist in the waypoint of the reverting failure data. For instance, if a waypoint had
// three keys and the waypoint we we want to revert to has 2 keys then the third key that doesn't exist in the failureData
// waypoint should be explicitly reset otherwise onyx merge will leave it intact.
// We need to include all keys of the optimisticData's waypoints in the failureData for onyx merge to properly reset
// waypoint keys that do not exist in the failureData's waypoints. For instance, if the optimisticData waypoints had
// three keys and the failureData waypoint had only 2 keys then the third key that doesn't exist in the failureData
// waypoints should be explicitly reset otherwise onyx merge will leave it intact.
const allWaypointKeys = [...new Set([...Object.keys(transactionBackup.comment?.waypoints ?? {}), ...Object.keys(transaction?.comment?.waypoints ?? {})])];
const onyxWaypoints = allWaypointKeys.reduce((acc: NullishDeep<WaypointCollection>, key) => {
acc[key] = transactionBackup.comment?.waypoints?.[key] ? {...transactionBackup.comment?.waypoints?.[key]} : null;
Expand Down

0 comments on commit 641ea6b

Please sign in to comment.