Skip to content

Commit

Permalink
minor updates.
Browse files Browse the repository at this point in the history
Signed-off-by: krishna2323 <[email protected]>
  • Loading branch information
Krishna2323 committed Oct 15, 2024
1 parent dfad015 commit 22ada28
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/pages/iou/request/step/IOURequestStepDistance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,15 +115,15 @@ function IOURequestStepDistance({
(participants: Participant[]) => {
// Get policy report based on transaction participants
const isPolicyExpenseChat = participants?.some((participant) => participant.isPolicyExpenseChat);
const selectedReportID = participants?.length === 1 ? participants[0]?.reportID ?? reportID : reportID;
const policyReport = participants?.[0] ? ReportUtils.getReport(selectedReportID) : report;
const selectedReportID = participants?.length === 1 ? participants.at(0)?.reportID ?? reportID : reportID;
const policyReport = participants.at(0) ? ReportUtils.getReport(selectedReportID) : report;

const policyID2 = IOU.getIOURequestPolicyID(transaction, policyReport);
const policy2 = PolicyUtils.getPolicy(report?.policyID ?? policyID2);
const IOUpolicyID = IOU.getIOURequestPolicyID(transaction, policyReport);
const IOUpolicy = PolicyUtils.getPolicy(report?.policyID ?? IOUpolicyID);
const policyCurrency = policy?.outputCurrency ?? PolicyUtils.getPersonalPolicy()?.outputCurrency ?? CONST.CURRENCY.USD;

const mileageRates = DistanceRequestUtils.getMileageRates(policy2);
const defaultMileageRate = DistanceRequestUtils.getDefaultMileageRate(policy2);
const mileageRates = DistanceRequestUtils.getMileageRates(IOUpolicy);
const defaultMileageRate = DistanceRequestUtils.getDefaultMileageRate(IOUpolicy);
const mileageRate: MileageRate = TransactionUtils.isCustomUnitRateIDForP2P(transaction)
? DistanceRequestUtils.getRateForP2P(policyCurrency)
: mileageRates?.[customUnitRateID] ?? defaultMileageRate;
Expand Down

0 comments on commit 22ada28

Please sign in to comment.