Skip to content

Commit 99b736e

Browse files
authored
Merge pull request #40298 from ShridharGoel/patch-4
Exclude domain rooms check from canSeeDefaultRooms
2 parents ab7f7ae + 49b77e4 commit 99b736e

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

src/libs/ReportUtils.ts

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -505,12 +505,6 @@ Onyx.connect({
505505
callback: (value) => (allReports = value),
506506
});
507507

508-
let doesDomainHaveApprovedAccountant = false;
509-
Onyx.connect({
510-
key: ONYXKEYS.ACCOUNT,
511-
callback: (value) => (doesDomainHaveApprovedAccountant = value?.doesDomainHaveApprovedAccountant ?? false),
512-
});
513-
514508
let allPolicies: OnyxCollection<Policy>;
515509
Onyx.connect({
516510
key: ONYXKEYS.COLLECTION.POLICY,
@@ -1073,14 +1067,6 @@ function canCreateTaskInReport(report: OnyxEntry<Report>): boolean {
10731067
return true;
10741068
}
10751069

1076-
/**
1077-
* Returns true if there are any Expensify accounts (i.e. with domain 'expensify.com') in the set of accountIDs
1078-
* by cross-referencing the accountIDs with personalDetails.
1079-
*/
1080-
function hasExpensifyEmails(accountIDs: number[]): boolean {
1081-
return accountIDs.some((accountID) => Str.extractEmailDomain(allPersonalDetails?.[accountID]?.login ?? '') === CONST.EXPENSIFY_PARTNER_NAME);
1082-
}
1083-
10841070
/**
10851071
* Returns true if there are any guides accounts (team.expensify.com) in a list of accountIDs
10861072
* by cross-referencing the accountIDs with personalDetails since guides that are participants
@@ -4549,11 +4535,6 @@ function canSeeDefaultRoom(report: OnyxEntry<Report>, policies: OnyxCollection<P
45494535
return true;
45504536
}
45514537

4552-
// Include domain rooms with Partner Managers (Expensify accounts) in them for accounts that are on a domain with an Approved Accountant
4553-
if (isDomainRoom(report) && doesDomainHaveApprovedAccountant && hasExpensifyEmails(report?.participantAccountIDs ?? [])) {
4554-
return true;
4555-
}
4556-
45574538
// If the room has an assigned guide, it can be seen.
45584539
if (hasExpensifyGuidesEmails(report?.participantAccountIDs ?? [])) {
45594540
return true;

0 commit comments

Comments
 (0)