Skip to content

Commit

Permalink
changes after cr
Browse files Browse the repository at this point in the history
  • Loading branch information
OlimpiaZurek committed Jul 25, 2024
1 parent aa69f38 commit 94b83c4
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/libs/ReportActionsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,13 @@ function isTaskAction(reportAction: OnyxEntry<ReportAction>): boolean {
);
}

// Get all IOU report actions for the report.
const iouRequestTypes = new Set<ValueOf<typeof CONST.IOU.REPORT_ACTION_TYPE>>([
CONST.IOU.REPORT_ACTION_TYPE.CREATE,
CONST.IOU.REPORT_ACTION_TYPE.SPLIT,
CONST.IOU.REPORT_ACTION_TYPE.PAY,
CONST.IOU.REPORT_ACTION_TYPE.TRACK,
]);
/**
* Gets the reportID for the transaction thread associated with a report by iterating over the reportActions and identifying the IOU report actions.
* Returns a reportID if there is exactly one transaction thread for the report, and null otherwise.
Expand All @@ -971,14 +978,6 @@ function getOneTransactionThreadReportID(reportID: string, reportActions: OnyxEn
return;
}

// Get all IOU report actions for the report.
const iouRequestTypes = new Set<ValueOf<typeof CONST.IOU.REPORT_ACTION_TYPE>>([
CONST.IOU.REPORT_ACTION_TYPE.CREATE,
CONST.IOU.REPORT_ACTION_TYPE.SPLIT,
CONST.IOU.REPORT_ACTION_TYPE.PAY,
CONST.IOU.REPORT_ACTION_TYPE.TRACK,
]);

const iouRequestActions = [];
for (const action of reportActionsArray) {
if (!isMoneyRequestAction(action)) {
Expand Down Expand Up @@ -1015,7 +1014,7 @@ function getOneTransactionThreadReportID(reportID: string, reportActions: OnyxEn

// If there's only one IOU request action associated with the report but it's been deleted, then we don't consider this a oneTransaction report
// and want to display it using the standard view
if (isMoneyRequestAction(singleAction) && (originalMessage?.deleted ?? '') !== '') {
if ((originalMessage?.deleted ?? '') !== '' && isMoneyRequestAction(singleAction)) {
return;
}

Expand Down

0 comments on commit 94b83c4

Please sign in to comment.