diff --git a/src/pages/ReportParticipantsPage.tsx b/src/pages/ReportParticipantsPage.tsx index a1a51016fd73f..90128a4ef9935 100755 --- a/src/pages/ReportParticipantsPage.tsx +++ b/src/pages/ReportParticipantsPage.tsx @@ -29,7 +29,7 @@ import useSearchBackPress from '@hooks/useSearchBackPress'; import useStyleUtils from '@hooks/useStyleUtils'; import useThemeStyles from '@hooks/useThemeStyles'; import {turnOffMobileSelectionMode} from '@libs/actions/MobileSelectionMode'; -import {removeFromGroupChat, updateGroupChatMemberRoles} from '@libs/actions/Report'; +import {openRoomMembersPage, removeFromGroupChat, updateGroupChatMemberRoles} from '@libs/actions/Report'; import {clearUserSearchPhrase} from '@libs/actions/RoomMembersUserSearchPhrase'; import Navigation from '@libs/Navigation/Navigation'; import type {PlatformStackScreenProps} from '@libs/Navigation/PlatformStackNavigation/types'; @@ -39,6 +39,7 @@ import {getDisplayNameOrDefault, getPersonalDetailsByIDs} from '@libs/PersonalDe import {getReportName} from '@libs/ReportNameUtils'; import { getReportPersonalDetailsParticipants, + isAnnounceRoom, isArchivedNonExpenseReport, isChatRoom, isChatThread, @@ -133,6 +134,15 @@ function ReportParticipantsPage({report, route}: ReportParticipantsPageProps) { } }, [isFocused, setSearchValue, shouldShowTextInput, userSearchPhrase]); + useEffect(() => { + if (!isAnnounceRoom(report)) { + return; + } + openRoomMembersPage(report.reportID); + // We only want to fetch room members once on mount, not when report changes + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + useSearchBackPress({ onClearSelection: () => setSelectedMembers([]), onNavigationCallBack: () => {