From e14eea0b00439553f8f560765ddb1e196def1b86 Mon Sep 17 00:00:00 2001 From: Francois Laithier Date: Mon, 25 Nov 2024 17:01:49 -0800 Subject: [PATCH] Remove `getSystemChat()` function --- src/libs/ReportUtils.ts | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 952e0c2fe4cc..24d745cc7981 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -1228,6 +1228,8 @@ function isGroupChat(report: OnyxEntry | Partial): boolean { /** * Only returns true if this is the Expensify DM report. + * + * Note that this chat is no longer used for new users. We still need this function for users who have this chat. */ function isSystemChat(report: OnyxEntry): boolean { return getChatType(report) === CONST.REPORT.CHAT_TYPE.SYSTEM; @@ -6652,18 +6654,6 @@ function shouldReportBeInOptionList(params: ShouldReportBeInOptionListParams) { return reasonForReportToBeInOptionList(params) !== null; } -/** - * Returns the system report from the list of reports. - */ -function getSystemChat(): OnyxEntry { - const allReports = ReportConnection.getAllReports(); - if (!allReports) { - return undefined; - } - - return Object.values(allReports ?? {}).find((report) => report?.chatType === CONST.REPORT.CHAT_TYPE.SYSTEM); -} - /** * Attempts to find a report in onyx with the provided list of participants. Does not include threads, task, expense, room, and policy expense chat. */ @@ -8561,7 +8551,6 @@ export { getRoom, getRootParentReport, getRouteFromLink, - getSystemChat, getTaskAssigneeChatOnyxData, getTransactionDetails, getTransactionReportName,