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

Add teamdot check to SideBarUtils.js #11244

Merged
merged 2 commits into from
Sep 23, 2022
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
9 changes: 7 additions & 2 deletions src/libs/SidebarUtils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Onyx from 'react-native-onyx';
import _ from 'underscore';
import Str from 'expensify-common/lib/str';
import lodashGet from 'lodash/get';
import ONYXKEYS from '../ONYXKEYS';
import * as ReportUtils from './ReportUtils';
import * as Localize from './Localize';
Expand Down Expand Up @@ -143,8 +144,12 @@ function getOrderedReportIDs() {
return false;
}

// We let Free Plan default rooms to be shown in the App - it's the one exception to the beta, otherwise do not show policy rooms in product
if (ReportUtils.isDefaultRoom(report) && !Permissions.canUseDefaultRooms(betas) && ReportUtils.getPolicyType(report, policies) !== CONST.POLICY.TYPE.FREE) {
// We let Free Plan default rooms to be shown in the App, or rooms that also have a Guide in them.
// It's the two exceptions to the beta, otherwise do not show policy rooms in product
if (ReportUtils.isDefaultRoom(report)
&& !Permissions.canUseDefaultRooms(betas)
&& ReportUtils.getPolicyType(report, policies) !== CONST.POLICY.TYPE.FREE
&& !ReportUtils.hasExpensifyGuidesEmails(lodashGet(report, ['participants'], []))) {
return false;
}

Expand Down