Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
paultsimura committed Jul 20, 2024
1 parent 03bd854 commit b99e213
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2455,16 +2455,15 @@ function calculateAmountForUpdatedWaypointOrRate(
policy: OnyxTypes.OnyxInputOrEntry<OnyxTypes.Policy>,
iouReport: OnyxTypes.OnyxInputOrEntry<OnyxTypes.Report>,
) {
const hasModifiedRate = !isEmptyObject(transactionChanges.customUnitRateID);
if (isEmptyObject(transactionChanges?.routes?.route0?.geometry) && !hasModifiedRate) {
if (isEmptyObject(transactionChanges?.routes?.route0?.geometry) && isEmptyObject(transactionChanges.customUnitRateID)) {
return {
amount: CONST.IOU.DEFAULT_AMOUNT,
modifiedAmount: CONST.IOU.DEFAULT_AMOUNT,
modifiedMerchant: Localize.translateLocal('iou.fieldPending')
};
}

const customUnitRateID = hasModifiedRate ? transactionChanges.customUnitRateID! : TransactionUtils.getRateID(transaction) ?? '';
const customUnitRateID = !isEmptyObject(transactionChanges.customUnitRateID) ? transactionChanges.customUnitRateID : TransactionUtils.getRateID(transaction) ?? '';

const mileageRates = DistanceRequestUtils.getMileageRates(policy, true);
const policyCurrency = policy?.outputCurrency ?? PolicyUtils.getPersonalPolicy()?.outputCurrency ?? CONST.CURRENCY.USD;
Expand Down

0 comments on commit b99e213

Please sign in to comment.