Skip to content

Commit

Permalink
remove string default value
Browse files Browse the repository at this point in the history
  • Loading branch information
mkzie2 committed Feb 6, 2025
1 parent a5f4ff3 commit 1da5948
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libs/DistanceRequestUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,8 +367,9 @@ function getRate({
}
const policyCurrency = policy?.outputCurrency ?? getPersonalPolicy()?.outputCurrency ?? CONST.CURRENCY.USD;
const defaultMileageRate = getDefaultMileageRate(policy);
const customUnitRateID = getRateID(transaction) ?? String(CONST.DEFAULT_NUMBER_ID);
const customMileageRate = mileageRates?.[customUnitRateID] ?? defaultMileageRate;
const customUnitRateID = getRateID(transaction);
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
const customMileageRate = (customUnitRateID && mileageRates?.[customUnitRateID]) || defaultMileageRate;
const mileageRate = isCustomUnitRateIDForP2P(transaction) ? getRateForP2P(policyCurrency, transaction) : customMileageRate;
const unit = getDistanceUnit(useTransactionDistanceUnit ? transaction : undefined, mileageRate);
return {
Expand Down

0 comments on commit 1da5948

Please sign in to comment.