Skip to content

Commit

Permalink
add early return
Browse files Browse the repository at this point in the history
  • Loading branch information
TMisiukiewicz committed Jan 23, 2025
1 parent f1f00db commit 52caad0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libs/WorkspacesSettingsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ function hasWorkspaceSettingsRBR(policy: Policy) {
}

function getChatTabBrickRoadReport(policyID: string | undefined, orderedReportIDs: string[] = []): OnyxEntry<Report> {
if (!orderedReportIDs.length) {
return undefined;
}

const allReports = orderedReportIDs.map((reportID) => reportsCollection?.[`${ONYXKEYS.COLLECTION.REPORT}${reportID}`]);
// If policyID is undefined, then all reports are checked whether they contain any brick road
const policyReports = policyID ? Object.values(allReports).filter((report) => report?.policyID === policyID) : Object.values(allReports);
Expand Down

0 comments on commit 52caad0

Please sign in to comment.