Skip to content
Merged
Show file tree
Hide file tree
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
12 changes: 8 additions & 4 deletions src/libs/OptionsListUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ function getOptions(reports, personalDetails, activeReportID, {
selectedOptions = [],
maxRecentReportsToShow = 0,
excludeLogins = [],
excludeDefaultRooms = false,
excludeChatRooms = false,
includeMultipleParticipantReports = false,
includePersonalDetails = false,
includeRecentReports = false,
Expand Down Expand Up @@ -439,18 +439,22 @@ function getOptions(reports, personalDetails, activeReportID, {
return;
}

if (isChatRoom && (!Permissions.canUseDefaultRooms(betas) || excludeDefaultRooms)) {
if (isChatRoom && excludeChatRooms) {
return;
}

if (isPolicyExpenseChat && !Permissions.canUsePolicyExpenseChat(betas)) {
if (ReportUtils.isDefaultRoom(report) && !Permissions.canUseDefaultRooms(betas)) {
return;
}

if (ReportUtils.isUserCreatedPolicyRoom(report) && !Permissions.canUsePolicyRooms(betas)) {
return;
}

if (isPolicyExpenseChat && !Permissions.canUsePolicyExpenseChat(betas)) {
return;
}

// Save the report in the map if this is a single participant so we can associate the reportID with the
// personal detail option later. Individuals should not be associated with single participant
// policyExpenseChats or chatRooms since those are not people.
Expand Down Expand Up @@ -703,7 +707,7 @@ function getNewChatOptions(
betas,
searchValue: searchValue.trim(),
selectedOptions,
excludeDefaultRooms: true,
excludeChatRooms: true,
includeRecentReports: true,
includePersonalDetails: true,
maxRecentReportsToShow: 5,
Expand Down
6 changes: 5 additions & 1 deletion src/pages/home/ReportScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,11 @@ class ReportScreen extends React.Component {
return null;
}

if (!Permissions.canUseDefaultRooms(this.props.betas) && ReportUtils.isChatRoom(this.props.report)) {
if (!Permissions.canUseDefaultRooms(this.props.betas) && ReportUtils.isDefaultRoom(this.props.report)) {
return null;
}

if (!Permissions.canUsePolicyRooms(this.props.betas) && ReportUtils.isUserCreatedPolicyRoom(this.props.report)) {
return null;
}

Expand Down
4 changes: 2 additions & 2 deletions src/pages/workspace/WorkspaceNewRoomPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ class WorkspaceNewRoomPage extends React.Component {
}

render() {
if (!Permissions.canUseDefaultRooms(this.props.betas)) {
Log.info('Not showing create Policy Room page since user is not on default rooms beta');
if (!Permissions.canUsePolicyRooms(this.props.betas)) {
Log.info('Not showing create Policy Room page since user is not on policy rooms beta');
Navigation.dismissModal();
return null;
}
Expand Down