From a284d2830ea95a10efffe967e8e79255614d75c8 Mon Sep 17 00:00:00 2001 From: Someshwar Tripathi Date: Fri, 19 Apr 2024 16:40:58 +0530 Subject: [PATCH 1/3] Fix logic for rendering avatars in Report Details Page --- src/pages/ReportDetailsPage.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/ReportDetailsPage.tsx b/src/pages/ReportDetailsPage.tsx index bc55511cee71..60b8c8645007 100644 --- a/src/pages/ReportDetailsPage.tsx +++ b/src/pages/ReportDetailsPage.tsx @@ -82,6 +82,7 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD const chatRoomSubtitle = useMemo(() => ReportUtils.getChatRoomSubtitle(report), [report, policy]); const parentNavigationSubtitleData = ReportUtils.getParentNavigationSubtitle(report); const isGroupChat = useMemo(() => ReportUtils.isGroupChat(report), [report]); + const isThread = useMemo(() => ReportUtils.isThread(report), [report]); const participants = useMemo(() => { if (isGroupChat) { return ReportUtils.getParticipantAccountIDs(report.reportID ?? ''); @@ -227,7 +228,7 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD /> ) : null; - const renderAvatar = isGroupChat ? ( + const renderAvatar = isGroupChat && !isThread ? ( Date: Fri, 19 Apr 2024 16:42:30 +0530 Subject: [PATCH 2/3] Fix Navigation when leaving Group Chats --- src/libs/actions/Report.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/Report.ts b/src/libs/actions/Report.ts index a4afff17d972..35de6c9ea1f9 100644 --- a/src/libs/actions/Report.ts +++ b/src/libs/actions/Report.ts @@ -2421,7 +2421,7 @@ function navigateToMostRecentReport(currentReport: OnyxEntry) { if (!isChatThread) { Navigation.goBack(); } - Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(lastAccessedReportID ?? '')); + Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(lastAccessedReportID ?? ''), CONST.NAVIGATION.TYPE.FORCED_UP); } else { const participantAccountIDs = PersonalDetailsUtils.getAccountIDsByLogins([CONST.EMAIL.CONCIERGE]); const chat = ReportUtils.getChatByParticipants(participantAccountIDs); @@ -2430,7 +2430,7 @@ function navigateToMostRecentReport(currentReport: OnyxEntry) { if (!isChatThread) { Navigation.goBack(); } - Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(chat?.reportID)); + Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(chat?.reportID), CONST.NAVIGATION.TYPE.FORCED_UP); } } } From 7071f2e1634fc4c1772c81fca4bd8b341c44906b Mon Sep 17 00:00:00 2001 From: Someshwar Tripathi Date: Fri, 19 Apr 2024 16:45:02 +0530 Subject: [PATCH 3/3] Prettier --- src/pages/ReportDetailsPage.tsx | 43 +++++++++++++++++---------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/src/pages/ReportDetailsPage.tsx b/src/pages/ReportDetailsPage.tsx index 60b8c8645007..3a7f4ad6f28d 100644 --- a/src/pages/ReportDetailsPage.tsx +++ b/src/pages/ReportDetailsPage.tsx @@ -228,27 +228,28 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD /> ) : null; - const renderAvatar = isGroupChat && !isThread ? ( - { - // Calling this without a file will remove the avatar - Report.updateGroupChatAvatar(report.reportID ?? ''); - }} - onImageSelected={(file) => Report.updateGroupChatAvatar(report.reportID ?? '', file)} - editIcon={Expensicons.Camera} - editIconStyle={styles.smallEditIconAccount} - /> - ) : ( - - ); + const renderAvatar = + isGroupChat && !isThread ? ( + { + // Calling this without a file will remove the avatar + Report.updateGroupChatAvatar(report.reportID ?? ''); + }} + onImageSelected={(file) => Report.updateGroupChatAvatar(report.reportID ?? '', file)} + editIcon={Expensicons.Camera} + editIconStyle={styles.smallEditIconAccount} + /> + ) : ( + + ); const reportName = ReportUtils.isDeprecatedGroupDM(report) || ReportUtils.isGroupChat(report)