Skip to content

Commit

Permalink
Merge pull request #32419 from s-alves10/fix/issue-31732
Browse files Browse the repository at this point in the history
fix: sort participant avatars by its accountID
  • Loading branch information
robertjchen authored Dec 12, 2023
2 parents 86a2521 + 527075d commit d3724c8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/components/ReportActionItem/MoneyRequestPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,9 @@ function MoneyRequestPreview(props) {

const participantAccountIDs = props.isBillSplit ? lodashGet(props.action, 'originalMessage.participantAccountIDs', []) : [managerID, ownerAccountID];
const participantAvatars = OptionsListUtils.getAvatarsForAccountIDs(participantAccountIDs, props.personalDetails);
const sortedParticipantAvatars = _.sortBy(participantAvatars, (avatar) => avatar.id);
if (isPolicyExpenseChat && props.isBillSplit) {
participantAvatars.push(ReportUtils.getWorkspaceIcon(props.chatReport));
sortedParticipantAvatars.push(ReportUtils.getWorkspaceIcon(props.chatReport));
}

// Pay button should only be visible to the manager of the report.
Expand Down Expand Up @@ -298,7 +299,8 @@ function MoneyRequestPreview(props) {
<Text
style={[
styles.textHeadline,
props.isBillSplit && StyleUtils.getAmountFontSizeAndLineHeight(isSmallScreenWidth, windowWidth, displayAmount.length, participantAvatars.length),
props.isBillSplit &&
StyleUtils.getAmountFontSizeAndLineHeight(isSmallScreenWidth, windowWidth, displayAmount.length, sortedParticipantAvatars.length),
isDeleted && styles.lineThrough,
]}
numberOfLines={1}
Expand All @@ -317,7 +319,7 @@ function MoneyRequestPreview(props) {
{props.isBillSplit && (
<View style={styles.moneyRequestPreviewBoxAvatar}>
<MultipleAvatars
icons={participantAvatars}
icons={sortedParticipantAvatars}
shouldStackHorizontally
size="small"
isHovered={props.isHovered}
Expand Down

0 comments on commit d3724c8

Please sign in to comment.