Skip to content

Commit

Permalink
Merge pull request Expensify#41954 from gijoe0295/gijoe/41084
Browse files Browse the repository at this point in the history
fix: report preview link in thread is incorrect
  • Loading branch information
bondydaa authored May 13, 2024
2 parents 21e69b3 + 4fb3bd0 commit 5aa12fa
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5710,12 +5710,10 @@ function getOriginalReportID(reportID: string, reportAction: OnyxEntry<ReportAct
const reportActions = allReportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`];
const currentReportAction = reportActions?.[reportAction?.reportActionID ?? ''] ?? null;
const transactionThreadReportID = ReportActionsUtils.getOneTransactionThreadReportID(reportID, reportActions ?? ([] as ReportAction[]));
if (transactionThreadReportID !== null) {
return Object.keys(currentReportAction ?? {}).length === 0 ? transactionThreadReportID : reportID;
if (Object.keys(currentReportAction ?? {}).length === 0) {
return isThreadFirstChat(reportAction, reportID) ? allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]?.parentReportID : transactionThreadReportID ?? reportID;
}
return isThreadFirstChat(reportAction, reportID) && Object.keys(currentReportAction ?? {}).length === 0
? allReports?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]?.parentReportID
: reportID;
return reportID;
}

/**
Expand Down

0 comments on commit 5aa12fa

Please sign in to comment.