From 7abbdf5dd7a67992b66414ec96ebd661d26b5566 Mon Sep 17 00:00:00 2001 From: Someshwar Tripathi Date: Mon, 29 Apr 2024 16:51:06 +0530 Subject: [PATCH 1/4] Add check for logged out user --- src/pages/home/report/ReportFooter.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportFooter.tsx b/src/pages/home/report/ReportFooter.tsx index 11d9a0a4871d..1f352ed8a440 100644 --- a/src/pages/home/report/ReportFooter.tsx +++ b/src/pages/home/report/ReportFooter.tsx @@ -141,7 +141,7 @@ function ReportFooter({ /> )} {isArchivedRoom && } - {!canWriteInReport && } + {!isAnonymousUser && !canWriteInReport && } {!isSmallScreenWidth && {hideComposer && }} )} From a52d6b3ad20576f479cad78e73b418ee3975523c Mon Sep 17 00:00:00 2001 From: Someshwar Tripathi Date: Mon, 29 Apr 2024 22:33:52 +0530 Subject: [PATCH 2/4] Add system chatType --- src/CONST.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/CONST.ts b/src/CONST.ts index 66b51184852f..41eb6b1e760d 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -56,6 +56,7 @@ const chatTypes = { POLICY_EXPENSE_CHAT: 'policyExpenseChat', SELF_DM: 'selfDM', INVOICE: 'invoice', + SYSTEM: 'system', } as const; // Explicit type annotation is required From 85bca6a14835fd822969e879406c4ffe2e6a6497 Mon Sep 17 00:00:00 2001 From: Someshwar Tripathi Date: Mon, 29 Apr 2024 22:41:54 +0530 Subject: [PATCH 3/4] Add isSystemChat util function --- src/libs/ReportUtils.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index a0da34416aad..481977a53784 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -993,6 +993,10 @@ function isGroupChat(report: OnyxEntry | Partial): boolean { return getChatType(report) === CONST.REPORT.CHAT_TYPE.GROUP; } +function isSystemChat(report: OnyxEntry): boolean { + return getChatType(report) === CONST.REPORT.CHAT_TYPE.SYSTEM; +} + /** * Only returns true if this is our main 1:1 DM report with Concierge */ @@ -6536,6 +6540,7 @@ export { isReportParticipant, isSelfDM, isSettled, + isSystemChat, isTaskReport, isThread, isThreadFirstChat, From c8e9484cc1c370156ff4069f204c69e6bf32a246 Mon Sep 17 00:00:00 2001 From: Someshwar Tripathi Date: Mon, 29 Apr 2024 22:46:35 +0530 Subject: [PATCH 4/4] Add system chat check when rendering footer --- src/pages/home/report/ReportFooter.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportFooter.tsx b/src/pages/home/report/ReportFooter.tsx index 1f352ed8a440..9a8ca2955127 100644 --- a/src/pages/home/report/ReportFooter.tsx +++ b/src/pages/home/report/ReportFooter.tsx @@ -83,6 +83,7 @@ function ReportFooter({ const isSmallSizeLayout = windowWidth - (isSmallScreenWidth ? 0 : variables.sideBarWidth) < variables.anonymousReportFooterBreakpoint; const hideComposer = !ReportUtils.canUserPerformWriteAction(report); const canWriteInReport = ReportUtils.canWriteInReport(report); + const isSystemChat = ReportUtils.isSystemChat(report); const allPersonalDetails = usePersonalDetails(); @@ -141,7 +142,7 @@ function ReportFooter({ /> )} {isArchivedRoom && } - {!isAnonymousUser && !canWriteInReport && } + {!isAnonymousUser && !canWriteInReport && isSystemChat && } {!isSmallScreenWidth && {hideComposer && }} )}