From 00b5c0626b83bbb5ca01343c8aa0030307d47c92 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Wed, 21 Aug 2024 14:35:37 +0800 Subject: [PATCH 1/2] hide add to group button for notification and chronos account --- src/CONST.ts | 4 ++++ src/pages/NewChatPage.tsx | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/CONST.ts b/src/CONST.ts index 9d7f245b5464..8f67dabc6855 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -2474,6 +2474,10 @@ const CONST = { get RESTRICTED_ACCOUNT_IDS() { return [this.ACCOUNT_ID.NOTIFICATIONS]; }, + // Account IDs that can't be added as a group member + get NON_ADDABLE_ACCOUNT_IDS() { + return [this.ACCOUNT_ID.NOTIFICATIONS, this.ACCOUNT_ID.CHRONOS]; + }, // Auth limit is 60k for the column but we store edits and other metadata along the html so let's use a lower limit to accommodate for it. MAX_COMMENT_LENGTH: 10000, diff --git a/src/pages/NewChatPage.tsx b/src/pages/NewChatPage.tsx index 4b8557dfbac3..effd450698a8 100755 --- a/src/pages/NewChatPage.tsx +++ b/src/pages/NewChatPage.tsx @@ -227,7 +227,7 @@ function NewChatPage({isGroupChat}: NewChatPageProps) { const itemRightSideComponent = useCallback( (item: ListItem & OptionsListUtils.Option, isFocused?: boolean) => { - if (item.isSelfDM) { + if (item.isSelfDM || (item.accountID && CONST.NON_ADDABLE_ACCOUNT_IDS.includes(item.accountID))) { return null; } /** From 140dcff649ff419720afd49a65e281f6fe00648e Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Fri, 23 Aug 2024 23:10:57 +0800 Subject: [PATCH 2/2] lint --- src/pages/NewChatPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/NewChatPage.tsx b/src/pages/NewChatPage.tsx index effd450698a8..24cd75f870ec 100755 --- a/src/pages/NewChatPage.tsx +++ b/src/pages/NewChatPage.tsx @@ -227,7 +227,7 @@ function NewChatPage({isGroupChat}: NewChatPageProps) { const itemRightSideComponent = useCallback( (item: ListItem & OptionsListUtils.Option, isFocused?: boolean) => { - if (item.isSelfDM || (item.accountID && CONST.NON_ADDABLE_ACCOUNT_IDS.includes(item.accountID))) { + if (!!item.isSelfDM || (item.accountID && CONST.NON_ADDABLE_ACCOUNT_IDS.includes(item.accountID))) { return null; } /**