Skip to content

Commit

Permalink
fix: lint and typecheck
Browse files Browse the repository at this point in the history
  • Loading branch information
koko57 committed Jun 11, 2024
1 parent 2015e43 commit 5dc7f6c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5437,6 +5437,17 @@ function shouldReportBeInOptionList({
return true;
}

/**
* Returns the system report from the list of reports.
*/
function getSystemChat(): OnyxEntry<Report> {
if (!allReports) {
return null;
}

return Object.values(allReports ?? {}).find((report) => report?.chatType === CONST.REPORT.CHAT_TYPE.SYSTEM) ?? null;
}

/**
* 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 @@ -7058,6 +7069,7 @@ export {
getRoomWelcomeMessage,
getRootParentReport,
getRouteFromLink,
getSystemChat,
getTaskAssigneeChatOnyxData,
getTransactionDetails,
getTransactionReportName,
Expand Down
2 changes: 1 addition & 1 deletion src/libs/actions/Report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2014,7 +2014,7 @@ function navigateToConciergeChat(shouldDismissModal = false, checkIfCurrentPageA
function navigateToSystemChat() {
const systemChatReport = ReportUtils.getSystemChat();

if (systemChatReport && systemChatReport.reportID) {
if (systemChatReport?.reportID) {
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(systemChatReport.reportID));
}
}
Expand Down

0 comments on commit 5dc7f6c

Please sign in to comment.