From a0a3ff047054fb3b79f56369ee5cca6c78da28b6 Mon Sep 17 00:00:00 2001 From: NikkiWines Date: Thu, 4 Apr 2024 16:49:44 -0700 Subject: [PATCH] only include deleted IOUs if they have visible child actions we need to display --- src/libs/ReportActionsUtils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index 434cabbf2bb6..e6c63df9d9a9 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -230,8 +230,8 @@ function getOneTransactionThreadReportID(reportActions: OnyxEntry action.actionName === CONST.REPORT.ACTIONS.TYPE.IOU && (iouRequestTypes.includes(action.originalMessage.type) ?? []) && action.childReportID && - // Include deleted IOU reportActions because they might have associated comments that we'd want to display - (action.originalMessage.deleted || action.originalMessage.IOUTransactionID), + // Include deleted IOU reportActions if they have childAactions because we want to display those comments + ((action.originalMessage.deleted && action.childVisibleActionCount) || action.originalMessage.IOUTransactionID), ); // If we don't have any IOU request actions, or we have more than one IOU request actions, this isn't a oneTransaction report