Skip to content

Commit

Permalink
use announce and admin room report id from policy
Browse files Browse the repository at this point in the history
  • Loading branch information
rojiphil committed Jan 16, 2024
1 parent 8e2fb67 commit 3b5f6e5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/pages/workspace/WorkspaceInitialPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,22 +206,22 @@ function WorkspaceInitialPage(props) {
onSelected: () => setIsDeleteModalOpen(true),
},
];
if (adminsRoom) {
if (adminsRoom || policy.chatReportIDAdmins) {
items.push({
icon: Expensicons.Hashtag,
text: translate('workspace.common.goToRoom', {roomName: CONST.REPORT.WORKSPACE_CHAT_ROOMS.ADMINS}),
onSelected: () => Navigation.dismissModal(adminsRoom.reportID),
onSelected: () => Navigation.dismissModal(adminsRoom ? adminsRoom.reportID : policy.chatReportIDAdmins.toString()),
});
}
if (announceRoom) {
if (announceRoom || policy.chatReportIDAnnounce) {
items.push({
icon: Expensicons.Hashtag,
text: translate('workspace.common.goToRoom', {roomName: CONST.REPORT.WORKSPACE_CHAT_ROOMS.ANNOUNCE}),
onSelected: () => Navigation.dismissModal(announceRoom.reportID),
onSelected: () => Navigation.dismissModal(announceRoom ? announceRoom.reportID : policy.chatReportIDAnnounce.toString()),
});
}
return items;
}, [adminsRoom, announceRoom, translate]);
}, [adminsRoom, announceRoom, translate, policy]);

const prevPolicy = usePrevious(policy);

Expand Down

0 comments on commit 3b5f6e5

Please sign in to comment.