@@ -3,7 +3,6 @@ import {View} from 'react-native';
33import type { OnyxEntry } from 'react-native-onyx' ;
44import useEnvironment from '@hooks/useEnvironment' ;
55import useLocalize from '@hooks/useLocalize' ;
6- import useMappedPersonalDetails , { personalDetailMapper } from '@hooks/useMappedPersonalDetails' ;
76import useOnyx from '@hooks/useOnyx' ;
87import usePreferredPolicy from '@hooks/usePreferredPolicy' ;
98import useReportAttributes from '@hooks/useReportAttributes' ;
@@ -28,7 +27,7 @@ import CONST from '@src/CONST';
2827import type { IOUType } from '@src/CONST' ;
2928import ONYXKEYS from '@src/ONYXKEYS' ;
3029import ROUTES from '@src/ROUTES' ;
31- import type { OnyxInputOrEntry , PersonalDetailsList , Policy , Report } from '@src/types/onyx' ;
30+ import type { Policy , Report } from '@src/types/onyx' ;
3231import RenderHTML from './RenderHTML' ;
3332import Text from './Text' ;
3433
@@ -45,7 +44,7 @@ function ReportWelcomeText({report, policy}: ReportWelcomeTextProps) {
4544 const styles = useThemeStyles ( ) ;
4645 const { environmentURL} = useEnvironment ( ) ;
4746 const reportAttributes = useReportAttributes ( ) ;
48- const [ personalDetails ] = useMappedPersonalDetails ( personalDetailMapper ) ;
47+ const [ personalDetails ] = useOnyx ( ONYXKEYS . PERSONAL_DETAILS_LIST ) ;
4948 const { isRestrictedToPreferredPolicy} = usePreferredPolicy ( ) ;
5049 const isPolicyExpenseChat = isPolicyExpenseChatReportUtils ( report ) ;
5150 // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
@@ -108,9 +107,7 @@ function ReportWelcomeText({report, policy}: ReportWelcomeTextProps) {
108107 // If we are the only participant (e.g. solo group chat) then keep the current user personal details so the welcome message does not show up empty.
109108 const shouldExcludeCurrentUser = participantAccountIDs . length > 0 ;
110109 const participantAccountIDsExcludeCurrentUser = getParticipantsAccountIDsForDisplay ( report , undefined , undefined , shouldExcludeCurrentUser ) ;
111- const participantPersonalDetailListExcludeCurrentUser = Object . values (
112- getPersonalDetailsForAccountIDs ( participantAccountIDsExcludeCurrentUser , personalDetails as OnyxInputOrEntry < PersonalDetailsList > ) ,
113- ) ;
110+ const participantPersonalDetailListExcludeCurrentUser = Object . values ( getPersonalDetailsForAccountIDs ( participantAccountIDsExcludeCurrentUser , personalDetails ) ) ;
114111 const welcomeMessage = SidebarUtils . getWelcomeMessage ( {
115112 report,
116113 policy,
0 commit comments