Skip to content

Commit

Permalink
fix: new eslint rules
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillzyusko committed Dec 20, 2024
1 parent e4c77b7 commit ef04655
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/libs/DistanceRequestUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ function convertToDistanceInMeters(distance: number, unit: Unit): number {
/**
* Returns custom unit rate ID for the distance transaction
*/
function getCustomUnitRateID(reportID: string) {
function getCustomUnitRateID(reportID: string | undefined) {
const report = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`];
const parentReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${report?.parentReportID}`];
const policy = PolicyUtils.getPolicy(report?.policyID ?? parentReport?.policyID);
Expand Down
4 changes: 2 additions & 2 deletions src/pages/iou/request/step/IOURequestStepParticipants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function IOURequestStepParticipants({
(val: Participant[]) => {
HttpUtils.cancelPendingRequests(READ_COMMANDS.SEARCH_FOR_REPORTS);

const firstParticipantReportID = val.at(0)?.reportID ?? '';
const firstParticipantReportID = val.at(0)?.reportID;
const rateID = DistanceRequestUtils.getCustomUnitRateID(firstParticipantReportID);
const isInvoice = iouType === CONST.IOU.TYPE.INVOICE && ReportUtils.isInvoiceRoomWithID(firstParticipantReportID);
numberOfParticipants.current = val.length;
Expand All @@ -107,7 +107,7 @@ function IOURequestStepParticipants({
}

// When a participant is selected, the reportID needs to be saved because that's the reportID that will be used in the confirmation step.
selectedReportID.current = firstParticipantReportID || reportID;
selectedReportID.current = firstParticipantReportID ?? reportID;
},
[iouType, reportID, transactionID],
);
Expand Down

0 comments on commit ef04655

Please sign in to comment.