From 0d3f47beeac612f732d9d865b386b0f6fb02c775 Mon Sep 17 00:00:00 2001 From: someone-here Date: Wed, 21 Feb 2024 21:14:16 +0530 Subject: [PATCH 1/3] Prevent threads from being counted as DMs --- 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 05e2db66d62..8f6d80f96f6 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -908,7 +908,7 @@ function isChatThread(report: OnyxEntry): boolean { } function isDM(report: OnyxEntry): boolean { - return isChatReport(report) && !getChatType(report); + return isChatReport(report) && !getChatType(report) && !isThread(report); } /** From ef0851a5dcf231619d9f03059656b81ffdeb1858 Mon Sep 17 00:00:00 2001 From: someone-here Date: Wed, 6 Mar 2024 22:37:01 +0530 Subject: [PATCH 2/3] Remove redundant isThread Checks --- src/libs/ReportUtils.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 0c5792a7fd3..4a7550718f1 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -1151,7 +1151,7 @@ function hasOnlyTransactionsWithPendingRoutes(iouReportID: string | undefined): * If the report is a thread and has a chat type set, it is a workspace chat. */ function isWorkspaceThread(report: OnyxEntry): boolean { - return isThread(report) && isChatReport(report) && !isDM(report); + return isChatReport(report) && !isDM(report); } /** @@ -1217,7 +1217,6 @@ function isMoneyRequestReport(reportOrID: OnyxEntry | string): boolean { function isOneOnOneChat(report: OnyxEntry): boolean { const participantAccountIDs = report?.participantAccountIDs ?? []; return ( - !isThread(report) && !isChatRoom(report) && !isExpenseRequest(report) && !isMoneyRequestReport(report) && From 6712b4589d94c2da01bbf157c388f57ff619238e Mon Sep 17 00:00:00 2001 From: someone-here Date: Mon, 11 Mar 2024 20:24:01 +0530 Subject: [PATCH 3/3] Fix workspace thread check --- 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 4a7550718f1..ed751c5c006 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -1151,7 +1151,7 @@ function hasOnlyTransactionsWithPendingRoutes(iouReportID: string | undefined): * If the report is a thread and has a chat type set, it is a workspace chat. */ function isWorkspaceThread(report: OnyxEntry): boolean { - return isChatReport(report) && !isDM(report); + return isThread(report) && isChatReport(report) && !isDM(report); } /**