From c0755f4338dc96e8d4d57fe066c9ca4adab0df4e Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Fri, 6 Sep 2024 14:53:18 +0700 Subject: [PATCH 1/2] fix: Users with an external domain are displayed as Hidden --- src/pages/ReportParticipantDetailsPage.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pages/ReportParticipantDetailsPage.tsx b/src/pages/ReportParticipantDetailsPage.tsx index f03b2475d5a7..40ffa76d9133 100644 --- a/src/pages/ReportParticipantDetailsPage.tsx +++ b/src/pages/ReportParticipantDetailsPage.tsx @@ -18,6 +18,7 @@ import useLocalize from '@hooks/useLocalize'; import useStyleUtils from '@hooks/useStyleUtils'; import useThemeStyles from '@hooks/useThemeStyles'; import * as Report from '@libs/actions/Report'; +import * as PersonalDetailsUtils from '@libs/PersonalDetailsUtils'; import * as ReportUtils from '@libs/ReportUtils'; import Navigation from '@navigation/Navigation'; import type {ParticipantsNavigatorParamList} from '@navigation/types'; @@ -54,6 +55,7 @@ function ReportParticipantDetails({personalDetails, report, route}: ReportPartic const details = personalDetails?.[accountID] ?? ({} as PersonalDetails); const fallbackIcon = details.fallbackIcon ?? ''; const displayName = details.displayName ?? ''; + const displayNameOrDefault = PersonalDetailsUtils.getDisplayNameOrDefault(details); const isCurrentUserAdmin = ReportUtils.isGroupChatAdmin(report, currentUserPersonalDetails?.accountID); const isSelectedMemberCurrentUser = accountID === currentUserPersonalDetails?.accountID; const removeUser = useCallback(() => { @@ -91,12 +93,12 @@ function ReportParticipantDetails({personalDetails, report, route}: ReportPartic size={CONST.AVATAR_SIZE.XLARGE} fallbackIcon={fallbackIcon} /> - {!!(details.displayName ?? '') && ( + {!!(displayNameOrDefault ?? '') && ( - {displayName} + {displayNameOrDefault} )} {isCurrentUserAdmin && ( From a8a663648f9733a4422d4270e01ba91c1007efef Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Sat, 7 Sep 2024 17:03:37 +0700 Subject: [PATCH 2/2] refactor code --- src/pages/ReportParticipantDetailsPage.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/pages/ReportParticipantDetailsPage.tsx b/src/pages/ReportParticipantDetailsPage.tsx index 40ffa76d9133..9f6ef65f7d93 100644 --- a/src/pages/ReportParticipantDetailsPage.tsx +++ b/src/pages/ReportParticipantDetailsPage.tsx @@ -54,8 +54,7 @@ function ReportParticipantDetails({personalDetails, report, route}: ReportPartic const member = report?.participants?.[accountID]; const details = personalDetails?.[accountID] ?? ({} as PersonalDetails); const fallbackIcon = details.fallbackIcon ?? ''; - const displayName = details.displayName ?? ''; - const displayNameOrDefault = PersonalDetailsUtils.getDisplayNameOrDefault(details); + const displayName = PersonalDetailsUtils.getDisplayNameOrDefault(details); const isCurrentUserAdmin = ReportUtils.isGroupChatAdmin(report, currentUserPersonalDetails?.accountID); const isSelectedMemberCurrentUser = accountID === currentUserPersonalDetails?.accountID; const removeUser = useCallback(() => { @@ -93,12 +92,12 @@ function ReportParticipantDetails({personalDetails, report, route}: ReportPartic size={CONST.AVATAR_SIZE.XLARGE} fallbackIcon={fallbackIcon} /> - {!!(displayNameOrDefault ?? '') && ( + {!!(displayName ?? '') && ( - {displayNameOrDefault} + {displayName} )} {isCurrentUserAdmin && (