From ada170ded0c5c8a135e8f57dd007f3386c6b9f66 Mon Sep 17 00:00:00 2001 From: FitseTLT Date: Fri, 12 Apr 2024 23:13:12 +0300 Subject: [PATCH 1/2] fix delete menu item appering bug for iou type parent report action --- 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 6197a29cd4a6..b94923089f5c 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -1438,9 +1438,10 @@ function canDeleteReportAction(reportAction: OnyxEntry, reportID: return false; } + const linkedReport = isChatThread(report) ? getReport(report?.parentReportID) : report; if (isActionOwner) { - if (!isEmptyObject(report) && isMoneyRequestReport(report)) { - return canAddOrDeleteTransactions(report); + if (!isEmptyObject(linkedReport) && isMoneyRequestReport(linkedReport)) { + return canAddOrDeleteTransactions(linkedReport); } return true; } From ab217f2cd9414768308fe3d5287fc36a0cb18561 Mon Sep 17 00:00:00 2001 From: FitseTLT Date: Tue, 16 Apr 2024 17:01:13 +0300 Subject: [PATCH 2/2] use isThreadFirstChat --- src/libs/ReportUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 6eb5dbbed55a..9b85506766a8 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -1439,7 +1439,7 @@ function canDeleteReportAction(reportAction: OnyxEntry, reportID: return false; } - const linkedReport = isChatThread(report) ? getReport(report?.parentReportID) : report; + const linkedReport = isThreadFirstChat(reportAction, reportID) ? getReport(report?.parentReportID) : report; if (isActionOwner) { if (!isEmptyObject(linkedReport) && isMoneyRequestReport(linkedReport)) { return canAddOrDeleteTransactions(linkedReport);