Skip to content

Commit

Permalink
Merge pull request Expensify#41430 from cretadn22/main
Browse files Browse the repository at this point in the history
Modify the condition to calculate amount again
  • Loading branch information
grgia authored May 2, 2024
2 parents f851f57 + 2f0ba0e commit f0bdf5b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/MoneyRequestConfirmationList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,12 +262,13 @@ function MoneyRequestConfirmationList({

const {unit, rate} = mileageRate ?? {};

const distance = TransactionUtils.getDistance(transaction);
const prevRate = usePrevious(rate);
const shouldCalculateDistanceAmount = isDistanceRequest && (iouAmount === 0 || prevRate !== rate);
const prevDistance = usePrevious(distance);
const shouldCalculateDistanceAmount = isDistanceRequest && (iouAmount === 0 || prevRate !== rate || prevDistance !== distance);

const currency = (mileageRate as MileageRate)?.currency ?? policyCurrency;

const distance = TransactionUtils.getDistance(transaction);
const taxRates = policy?.taxRates ?? null;

// A flag for showing the categories field
Expand Down

0 comments on commit f0bdf5b

Please sign in to comment.