Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NoQA] Remove getSystemChat() function #53103

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1228,6 +1228,8 @@ function isGroupChat(report: OnyxEntry<Report> | Partial<Report>): 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<Report>): boolean {
return getChatType(report) === CONST.REPORT.CHAT_TYPE.SYSTEM;
Expand Down Expand Up @@ -6652,18 +6654,6 @@ function shouldReportBeInOptionList(params: ShouldReportBeInOptionListParams) {
return reasonForReportToBeInOptionList(params) !== null;
}

/**
* Returns the system report from the list of reports.
*/
function getSystemChat(): OnyxEntry<Report> {
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.
*/
Expand Down Expand Up @@ -8561,7 +8551,6 @@ export {
getRoom,
getRootParentReport,
getRouteFromLink,
getSystemChat,
getTaskAssigneeChatOnyxData,
getTransactionDetails,
getTransactionReportName,
Expand Down
Loading