Skip to content

Commit

Permalink
Merge pull request #40287 from FitseTLT/fix-delete-menu-item-displayi…
Browse files Browse the repository at this point in the history
…ng-for-parent-message

fix delete menu item appearing bug for iou type parent message
  • Loading branch information
danieldoglas authored Apr 17, 2024
2 parents 21ee1a3 + ab217f2 commit 314f2d3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1442,9 +1442,10 @@ function canDeleteReportAction(reportAction: OnyxEntry<ReportAction>, reportID:
return false;
}

const linkedReport = isThreadFirstChat(reportAction, reportID) ? getReport(report?.parentReportID) : report;
if (isActionOwner) {
if (!isEmptyObject(report) && isMoneyRequestReport(report)) {
return canAddOrDeleteTransactions(report);
if (!isEmptyObject(linkedReport) && isMoneyRequestReport(linkedReport)) {
return canAddOrDeleteTransactions(linkedReport);
}
return true;
}
Expand Down

0 comments on commit 314f2d3

Please sign in to comment.