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 14a078f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/libs/TransactionUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import CONST from '@src/CONST';
import ONYXKEYS from '@src/ONYXKEYS';
import type {Beta, OnyxInputOrEntry, Policy, RecentWaypoint, ReviewDuplicates, TaxRate, TaxRates, Transaction, TransactionViolation, TransactionViolations} from '@src/types/onyx';
import type {Comment, Receipt, TransactionChanges, TransactionPendingFieldsKey, Waypoint, WaypointCollection} from '@src/types/onyx/Transaction';
import type {Unit} from '@src/types/onyx/Policy';
import {isEmptyObject} from '@src/types/utils/EmptyObject';
import type {IOURequestType} from './actions/IOU';
import type {TransactionMergeParams} from './API/parameters';
Expand Down
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 14a078f

Please sign in to comment.