diff --git a/src/components/MoneyRequestConfirmationList.tsx b/src/components/MoneyRequestConfirmationList.tsx index 17ee0d31d63c..1916d3c2892b 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