Skip to content

Commit

Permalink
Merge pull request #20612 from Expensify/paulogasparsv-fix-group-cont…
Browse files Browse the repository at this point in the history
…act-profile-navigation

Fix the navigation to chat group member profiles
  • Loading branch information
PauloGasparSv authored Jun 12, 2023
2 parents aa70abf + b9daeec commit 15d8c11
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/ReportWelcomeText.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ const ReportWelcomeText = (props) => {
const isChatRoom = ReportUtils.isChatRoom(props.report);
const isDefault = !(isChatRoom || isPolicyExpenseChat);
const participants = lodashGet(props.report, 'participants', []);
const participantAccountIDs = lodashGet(props.report, 'participantAccountIDs', []);
const isMultipleParticipant = participants.length > 1;
const displayNamesWithTooltips = ReportUtils.getDisplayNamesWithTooltips(OptionsListUtils.getPersonalDetailsForLogins(participants, props.personalDetails), isMultipleParticipant);
const roomWelcomeMessage = ReportUtils.getRoomWelcomeMessage(props.report);
Expand Down Expand Up @@ -98,7 +97,12 @@ const ReportWelcomeText = (props) => {
<UserDetailsTooltip accountID={accountID}>
<Text
style={[styles.textStrong]}
onPress={() => Navigation.navigate(ROUTES.getProfileRoute(participantAccountIDs[index]))}
onPress={() => {
const accountDetails = props.personalDetails[participants[index]];
if (accountDetails && accountDetails.accountID) {
Navigation.navigate(ROUTES.getProfileRoute(accountDetails.accountID));
}
}}
>
{displayName}
</Text>
Expand Down

0 comments on commit 15d8c11

Please sign in to comment.