Skip to content

Commit

Permalink
Explain the setMoneyRequestPendingFields call
Browse files Browse the repository at this point in the history
  • Loading branch information
paultsimura committed Feb 6, 2024
1 parent 1c849c3 commit 534b2c1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
9 changes: 6 additions & 3 deletions src/components/MoneyRequestConfirmationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,12 @@ function MoneyRequestConfirmationList(props) {
return;
}

if (isDistanceRequestWithPendingRoute) {
IOU.setMoneyRequestPendingFields(props.transactionID, {waypoints: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD});
}
/*
Set pending waypoints based on the route status. We should handle this dynamically to cover cases such as:
When the user completes the initial steps of the IOU flow offline and then goes online on the confirmation page.
In this scenario, the route will be fetched from the server, and the waypoints will no longer be pending.
*/
IOU.setMoneyRequestPendingFields(props.transactionID, {waypoints: isDistanceRequestWithPendingRoute ? CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD : null});

const distanceMerchant = DistanceRequestUtils.getDistanceMerchant(hasRoute, distance, unit, rate, currency, translate, toLocaleDigit);
IOU.setMoneyRequestMerchant_temporaryForRefactor(props.transactionID, distanceMerchant);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -474,9 +474,12 @@ function MoneyTemporaryForRefactorRequestConfirmationList({
return;
}

if (isDistanceRequestWithPendingRoute) {
IOU.setMoneyRequestPendingFields(transaction.transactionID, {waypoints: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD});
}
/*
Set pending waypoints based on the route status. We should handle this dynamically to cover cases such as:
When the user completes the initial steps of the IOU flow offline and then goes online on the confirmation page.
In this scenario, the route will be fetched from the server, and the waypoints will no longer be pending.
*/
IOU.setMoneyRequestPendingFields(transaction.transactionID, {waypoints: isDistanceRequestWithPendingRoute ? CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD : null});

const distanceMerchant = DistanceRequestUtils.getDistanceMerchant(hasRoute, distance, unit, rate, currency, translate, toLocaleDigit);
IOU.setMoneyRequestMerchant_temporaryForRefactor(transaction.transactionID, distanceMerchant);
Expand Down

0 comments on commit 534b2c1

Please sign in to comment.