From 464332a0672670022dcb2160febe24d8dfada094 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Thu, 25 Apr 2024 21:56:53 +0800 Subject: [PATCH 1/2] don't include report preview action in thread ancestors --- src/libs/ReportUtils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index f92106d40b6e..7110a82ec3ee 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -5901,7 +5901,7 @@ function getAllAncestorReportActions(report: Report | null | undefined): Ancesto const parentReport = getReport(parentReportID); const parentReportAction = ReportActionsUtils.getReportAction(parentReportID, parentReportActionID ?? '0'); - if (!parentReportAction || ReportActionsUtils.isTransactionThread(parentReportAction) || !parentReport) { + if (!parentReportAction || ReportActionsUtils.isTransactionThread(parentReportAction) || ReportActionsUtils.isReportPreviewAction(parentReportAction) || !parentReport) { break; } @@ -5940,7 +5940,7 @@ function getAllAncestorReportActionIDs(report: Report | null | undefined, includ const parentReport = getReport(parentReportID); const parentReportAction = ReportActionsUtils.getReportAction(parentReportID, parentReportActionID ?? '0'); - if (!parentReportAction || (!includeTransactionThread && ReportActionsUtils.isTransactionThread(parentReportAction)) || !parentReport) { + if (!parentReportAction || (!includeTransactionThread && (ReportActionsUtils.isTransactionThread(parentReportAction) || ReportActionsUtils.isReportPreviewAction(parentReportAction))) || !parentReport) { break; } From ff5c59763c948cc39e028ab93262a2d100f7ee2e Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Tue, 30 Apr 2024 01:28:34 +0800 Subject: [PATCH 2/2] prettier --- src/libs/ReportUtils.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 7110a82ec3ee..3506bedf21b4 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -5940,7 +5940,11 @@ function getAllAncestorReportActionIDs(report: Report | null | undefined, includ const parentReport = getReport(parentReportID); const parentReportAction = ReportActionsUtils.getReportAction(parentReportID, parentReportActionID ?? '0'); - if (!parentReportAction || (!includeTransactionThread && (ReportActionsUtils.isTransactionThread(parentReportAction) || ReportActionsUtils.isReportPreviewAction(parentReportAction))) || !parentReport) { + if ( + !parentReportAction || + (!includeTransactionThread && (ReportActionsUtils.isTransactionThread(parentReportAction) || ReportActionsUtils.isReportPreviewAction(parentReportAction))) || + !parentReport + ) { break; }