@@ -2684,15 +2684,16 @@ function isPayAtEndExpenseReport(report: OnyxEntry<Report>, transactions: Transa
26842684/**
26852685 * Checks if a report is a transaction thread associated with a report that has only one transaction
26862686 */
2687- function isOneTransactionThread(report: OnyxEntry<Report>, parentReport: OnyxEntry<Report>, threadParentReportAction: OnyxEntry<ReportAction>) {
2687+ // TODO: isOffline will be required eventually. Refactor issue: https://github.com/Expensify/App/issues/66407
2688+ function isOneTransactionThread(report: OnyxEntry<Report>, parentReport: OnyxEntry<Report>, threadParentReportAction: OnyxEntry<ReportAction>, isOffline?: boolean) {
26882689 if (!report || !parentReport) {
26892690 return false;
26902691 }
26912692
26922693 const parentReportActions = allReportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${parentReport?.reportID}`] ?? ([] as ReportAction[]);
26932694
26942695 const chatReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${parentReport?.chatReportID}`];
2695- const transactionThreadReportID = getOneTransactionThreadReportID(parentReport, chatReport, parentReportActions);
2696+ const transactionThreadReportID = getOneTransactionThreadReportID(parentReport, chatReport, parentReportActions, isOffline );
26962697 return report?.reportID === transactionThreadReportID && !isSentMoneyReportAction(threadParentReportAction);
26972698}
26982699
@@ -2707,12 +2708,13 @@ function isReportTransactionThread(report: OnyxEntry<Report>) {
27072708/**
27082709 * Get displayed report ID, it will be parentReportID if the report is one transaction thread
27092710 */
2710- function getDisplayedReportID(reportID: string): string {
2711+ // TODO: isOffline will be required eventually. Refactor issue: https://github.com/Expensify/App/issues/66407
2712+ function getDisplayedReportID(reportID: string, isOffline?: boolean): string {
27112713 const report = getReport(reportID, allReports);
27122714 const parentReportID = report?.parentReportID;
27132715 const parentReport = allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${parentReportID}`];
27142716 const parentReportAction = getReportAction(parentReportID, report?.parentReportActionID);
2715- return parentReportID && isOneTransactionThread(report, parentReport, parentReportAction) ? parentReportID : reportID;
2717+ return parentReportID && isOneTransactionThread(report, parentReport, parentReportAction, isOffline ) ? parentReportID : reportID;
27162718}
27172719
27182720/**
0 commit comments