diff --git a/src/CONST.ts b/src/CONST.ts index 23cd7e87a2a8..135d4e114991 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 diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 6e8bc51c8848..b23b6ff89fec 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -998,6 +998,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 */ @@ -6637,6 +6641,7 @@ export { isReportParticipant, isSelfDM, isSettled, + isSystemChat, isTaskReport, isThread, isThreadFirstChat, diff --git a/src/pages/home/report/ReportFooter.tsx b/src/pages/home/report/ReportFooter.tsx index 11d9a0a4871d..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 && } - {!canWriteInReport && } + {!isAnonymousUser && !canWriteInReport && isSystemChat && } {!isSmallScreenWidth && {hideComposer && }} )}