From 4a1bd3e48aa8e3452c820ecc72ed742a544ba3b6 Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Sat, 9 Nov 2024 01:02:44 +0700 Subject: [PATCH] prevent showing track expense option for submitted track expense --- src/libs/ReportUtils.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index a104b98175c4..4bad5847ed90 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -1634,8 +1634,9 @@ function isIOURequest(report: OnyxInputOrEntry): boolean { */ function isTrackExpenseReport(report: OnyxInputOrEntry): boolean { if (isThread(report)) { + const selfDMReportID = findSelfDMReportID(); const parentReportAction = allReportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report.parentReportID}`]?.[report.parentReportActionID]; - return !isEmptyObject(parentReportAction) && ReportActionsUtils.isTrackExpenseAction(parentReportAction); + return !isEmptyObject(parentReportAction) && selfDMReportID === report.parentReportID && ReportActionsUtils.isTrackExpenseAction(parentReportAction); } return false; }