From f4659e14d9db2ff2af079655346c220bbe471d51 Mon Sep 17 00:00:00 2001 From: tienifr Date: Thu, 30 May 2024 04:16:23 +0700 Subject: [PATCH 1/3] fix LHN - Thread chat with violation is not removed from LHN --- src/libs/ReportUtils.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index a6fe52f4c7b2d..6c9259ec69395 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -5265,7 +5265,10 @@ function shouldReportBeInOptionList({ if (isSelfDM(report)) { return includeSelfDM; } - + const parentReportAction = ReportActionsUtils.getParentReportAction(report); + if (parentReportAction && ReportActionsUtils.isPendingRemove(parentReportAction) && ReportActionsUtils.isThreadParentMessage(parentReportAction, report?.reportID ?? '')) { + return false; + } return true; } From 715d9f37752dcc3e5a37835f7737f5d3ed2ea15a Mon Sep 17 00:00:00 2001 From: tienifr Date: Thu, 30 May 2024 04:26:01 +0700 Subject: [PATCH 2/3] fix lint --- src/libs/ReportUtils.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 6c9259ec69395..96a50d1ead892 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -5266,7 +5266,12 @@ function shouldReportBeInOptionList({ return includeSelfDM; } const parentReportAction = ReportActionsUtils.getParentReportAction(report); - if (parentReportAction && ReportActionsUtils.isPendingRemove(parentReportAction) && ReportActionsUtils.isThreadParentMessage(parentReportAction, report?.reportID ?? '')) { + if ( + parentReportAction && + !isEmptyObject(parentReportAction) && + ReportActionsUtils.isPendingRemove(parentReportAction) && + ReportActionsUtils.isThreadParentMessage(parentReportAction, report?.reportID ?? '') + ) { return false; } return true; From aa695fe3aeb07dfb16024e04e496ab5c3b250e8e Mon Sep 17 00:00:00 2001 From: tienifr Date: Wed, 5 Jun 2024 05:25:32 +0700 Subject: [PATCH 3/3] fix comment --- src/libs/ReportUtils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 329510baf38a2..f342ee61f85c7 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -5275,14 +5275,16 @@ function shouldReportBeInOptionList({ return includeSelfDM; } const parentReportAction = ReportActionsUtils.getParentReportAction(report); + + // Hide chat threads where the parent message is pending removal if ( - parentReportAction && !isEmptyObject(parentReportAction) && ReportActionsUtils.isPendingRemove(parentReportAction) && ReportActionsUtils.isThreadParentMessage(parentReportAction, report?.reportID ?? '') ) { return false; } + return true; }