diff --git a/src/components/MoneyRequestConfirmationList.tsx b/src/components/MoneyRequestConfirmationList.tsx index dd3e207c45fa..b2dac85f70eb 100755 --- a/src/components/MoneyRequestConfirmationList.tsx +++ b/src/components/MoneyRequestConfirmationList.tsx @@ -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