From 8142c68eb440f3d8e4422f8e0928c3a68ee63975 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Mon, 11 Nov 2024 22:36:44 +0700 Subject: [PATCH] fix: refactor function code --- src/libs/ReportUtils.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index ec9818ef8db2..a48613a633c4 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -1705,8 +1705,9 @@ function isOneTransactionThread(reportID: string, parentReportID: string, thread */ function getDisplayedReportID(reportID: string): string { const report = getReport(reportID); - const parentReportAction = ReportActionsUtils.getReportAction(report?.parentReportID ?? '-1', report?.parentReportActionID ?? '-1'); - return (isOneTransactionThread(report?.reportID ?? '', report?.parentReportID ?? '', parentReportAction) ? report?.parentReportID : reportID) ?? ''; + const parentReportID = report?.parentReportID ?? ''; + const parentReportAction = ReportActionsUtils.getReportAction(parentReportID, report?.parentReportActionID ?? ''); + return isOneTransactionThread(reportID, parentReportID, parentReportAction) ? parentReportID : reportID; } /**