Skip to content

Commit

Permalink
fix: report preview action link in thread is incorrect
Browse files Browse the repository at this point in the history
  • Loading branch information
gijoe0295 committed May 9, 2024
1 parent 505c7a7 commit 4fb3bd0
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 @@ -5692,12 +5692,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 4fb3bd0

Please sign in to comment.