From 2a469b090c8a8d53ff60866b25d392659433d5ff Mon Sep 17 00:00:00 2001 From: Daniel Gale-Rosen Date: Tue, 11 Jul 2023 15:50:34 -0400 Subject: [PATCH 1/2] only show threads with children --- src/libs/ReportActionsUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportActionsUtils.js b/src/libs/ReportActionsUtils.js index 9a280711e947..285d0d9c9c95 100644 --- a/src/libs/ReportActionsUtils.js +++ b/src/libs/ReportActionsUtils.js @@ -366,7 +366,7 @@ function shouldReportActionBeVisible(reportAction, key) { // All other actions are displayed except thread parents, deleted, or non-pending actions const isDeleted = isDeletedAction(reportAction); const isPending = !_.isEmpty(reportAction.pendingAction); - const isDeletedParentAction = lodashGet(reportAction, ['message', 0, 'isDeletedParentAction'], false); + const isDeletedParentAction = lodashGet(reportAction, ['message', 0, 'isDeletedParentAction'], false) && lodashGet(reportAction, 'childVisibleActionCount', 0) > 0; return !isDeleted || isPending || isDeletedParentAction; } From 1a90817489ad1ef757e22d17fa2732fc0ce6e911 Mon Sep 17 00:00:00 2001 From: Daniel Gale-Rosen Date: Wed, 12 Jul 2023 14:26:25 -0400 Subject: [PATCH 2/2] fix optimistic data too --- src/libs/ReportActionsUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportActionsUtils.js b/src/libs/ReportActionsUtils.js index 285d0d9c9c95..2e615426f85c 100644 --- a/src/libs/ReportActionsUtils.js +++ b/src/libs/ReportActionsUtils.js @@ -90,7 +90,7 @@ function isReportPreviewAction(reportAction) { * @returns {Boolean} */ function hasCommentThread(reportAction) { - return lodashGet(reportAction, 'childType', '') === CONST.REPORT.TYPE.CHAT; + return lodashGet(reportAction, 'childType', '') === CONST.REPORT.TYPE.CHAT && lodashGet(reportAction, 'childVisibleActionCount', 0) > 0; } /**