From f54febe271b60d4d9a6e08d37a0410f9c20f421c Mon Sep 17 00:00:00 2001 From: brunovjk Date: Thu, 16 May 2024 17:31:22 -0300 Subject: [PATCH 1/2] Using the 'RoomMembersPage' instead of 'ReportParticipantsPage' --- src/pages/ReportDetailsPage.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/pages/ReportDetailsPage.tsx b/src/pages/ReportDetailsPage.tsx index ca66a0e97bb5..093705ef1a8d 100644 --- a/src/pages/ReportDetailsPage.tsx +++ b/src/pages/ReportDetailsPage.tsx @@ -68,6 +68,7 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD const policy = useMemo(() => policies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID ?? ''}`], [policies, report?.policyID]); const isPolicyAdmin = useMemo(() => PolicyUtils.isPolicyAdmin(policy ?? null), [policy]); const isPolicyEmployee = useMemo(() => PolicyUtils.isPolicyEmployee(report?.policyID ?? '', policies), [report?.policyID, policies]); + const isPolicyExpenseChat = ReportUtils.isPolicyExpenseChat(report); const shouldUseFullTitle = useMemo(() => ReportUtils.shouldUseFullTitleToDisplay(report), [report]); const isChatRoom = useMemo(() => ReportUtils.isChatRoom(report), [report]); const isUserCreatedPolicyRoom = useMemo(() => ReportUtils.isUserCreatedPolicyRoom(report), [report]); @@ -152,17 +153,14 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD subtitle: activeChatMembers.length, isAnonymousAction: false, action: () => { - if (isUserCreatedPolicyRoom || isChatThread) { + if (isUserCreatedPolicyRoom || isChatThread || isPolicyExpenseChat) { Navigation.navigate(ROUTES.ROOM_MEMBERS.getRoute(report?.reportID ?? '')); } else { Navigation.navigate(ROUTES.REPORT_PARTICIPANTS.getRoute(report?.reportID ?? '')); } }, }); - } else if ( - (isUserCreatedPolicyRoom && (!participants.length || !isPolicyEmployee)) || - ((isDefaultRoom || ReportUtils.isPolicyExpenseChat(report)) && isChatThread && !isPolicyEmployee) - ) { + } else if ((isUserCreatedPolicyRoom && (!participants.length || !isPolicyEmployee)) || ((isDefaultRoom || isPolicyExpenseChat) && isChatThread && !isPolicyEmployee)) { items.push({ key: CONST.REPORT_DETAILS_MENU_ITEM.INVITE, translationKey: 'common.invite', From f9606ecaefb55236a3cc99cb7d4e89613630b4cc Mon Sep 17 00:00:00 2001 From: brunovjk Date: Thu, 16 May 2024 17:44:23 -0300 Subject: [PATCH 2/2] fix lint --- src/pages/ReportDetailsPage.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/ReportDetailsPage.tsx b/src/pages/ReportDetailsPage.tsx index 093705ef1a8d..1b9e5f81f512 100644 --- a/src/pages/ReportDetailsPage.tsx +++ b/src/pages/ReportDetailsPage.tsx @@ -203,6 +203,7 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD isDefaultRoom, isChatThread, isPolicyEmployee, + isPolicyExpenseChat, isUserCreatedPolicyRoom, participants.length, report,