diff --git a/src/pages/ReportDetailsPage.js b/src/pages/ReportDetailsPage.js index 442276b19a0b..221b269af789 100644 --- a/src/pages/ReportDetailsPage.js +++ b/src/pages/ReportDetailsPage.js @@ -93,7 +93,7 @@ function ReportDetailsPage(props) { return items; } - if ((!isUserCreatedPolicyRoom && participants.length) || (isUserCreatedPolicyRoom && isPolicyMember)) { + if ((!isUserCreatedPolicyRoom && participants.length) || (isUserCreatedPolicyRoom && (!ReportUtils.isPublicRoom(props.report) || isPolicyMember))) { items.push({ key: CONST.REPORT_DETAILS_MENU_ITEM.MEMBERS, translationKey: 'common.members', @@ -108,7 +108,7 @@ function ReportDetailsPage(props) { } }, }); - } else if ((!participants.length || !isPolicyMember) && isUserCreatedPolicyRoom && !props.report.parentReportID) { + } else if (isUserCreatedPolicyRoom && (!participants.length || !isPolicyMember) && !props.report.parentReportID) { items.push({ key: CONST.REPORT_DETAILS_MENU_ITEM.INVITE, translationKey: 'common.invite', diff --git a/src/pages/RoomInvitePage.js b/src/pages/RoomInvitePage.js index a1f7d22c3dc3..9b5b4f461652 100644 --- a/src/pages/RoomInvitePage.js +++ b/src/pages/RoomInvitePage.js @@ -14,7 +14,6 @@ import * as Browser from '@libs/Browser'; import compose from '@libs/compose'; import Navigation from '@libs/Navigation/Navigation'; import * as OptionsListUtils from '@libs/OptionsListUtils'; -import Permissions from '@libs/Permissions'; import * as PersonalDetailsUtils from '@libs/PersonalDetailsUtils'; import * as PolicyUtils from '@libs/PolicyUtils'; import * as ReportUtils from '@libs/ReportUtils'; @@ -73,16 +72,6 @@ function RoomInvitePage(props) { // Any existing participants and Expensify emails should not be eligible for invitation const excludedUsers = useMemo(() => [...PersonalDetailsUtils.getLoginsByAccountIDs(lodashGet(props.report, 'participantAccountIDs', [])), ...CONST.EXPENSIFY_EMAILS], [props.report]); - useEffect(() => { - // Kick the user out if they tried to navigate to this via the URL - if (Permissions.canUsePolicyRooms(props.betas)) { - return; - } - Navigation.goBack(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(props.report.reportID)); - - // eslint-disable-next-line react-hooks/exhaustive-deps - }, []); - useEffect(() => { const inviteOptions = OptionsListUtils.getMemberInviteOptions(props.personalDetails, props.betas, searchTerm, excludedUsers); diff --git a/src/pages/RoomMembersPage.js b/src/pages/RoomMembersPage.js index 662bedac71a5..23722625b961 100644 --- a/src/pages/RoomMembersPage.js +++ b/src/pages/RoomMembersPage.js @@ -18,7 +18,6 @@ import compose from '@libs/compose'; import Log from '@libs/Log'; import Navigation from '@libs/Navigation/Navigation'; import * as OptionsListUtils from '@libs/OptionsListUtils'; -import Permissions from '@libs/Permissions'; import * as PolicyUtils from '@libs/PolicyUtils'; import * as ReportUtils from '@libs/ReportUtils'; import * as UserUtils from '@libs/UserUtils'; @@ -31,9 +30,6 @@ import withReportOrNotFound from './home/report/withReportOrNotFound'; import reportPropTypes from './reportPropTypes'; const propTypes = { - /** Beta features list */ - betas: PropTypes.arrayOf(PropTypes.string), - /** The report currently being looked at */ report: reportPropTypes.isRequired, @@ -69,7 +65,6 @@ const defaultProps = { }, report: {}, policies: {}, - betas: [], ...withCurrentUserPersonalDetailsDefaultProps, }; @@ -90,11 +85,6 @@ function RoomMembersPage(props) { }, [props.report.reportID]); useEffect(() => { - // Kick the user out if they tried to navigate to this via the URL - if (!PolicyUtils.isPolicyMember(props.report.policyID, props.policies) || !Permissions.canUsePolicyRooms(props.betas)) { - Navigation.goBack(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(props.report.reportID)); - return; - } getRoomMembers(); // eslint-disable-next-line react-hooks/exhaustive-deps }, []); @@ -247,7 +237,7 @@ function RoomMembersPage(props) { testID={RoomMembersPage.displayName} > Navigation.goBack(ROUTES.REPORT_WITH_ID_DETAILS.getRoute(props.report.reportID))} > @@ -322,9 +312,6 @@ export default compose( policies: { key: ONYXKEYS.COLLECTION.POLICY, }, - betas: { - key: ONYXKEYS.BETAS, - }, }), withCurrentUserPersonalDetails, )(RoomMembersPage);