Skip to content

Fix - Split - Missing user avatars above amount in expense preview when expense is split offline #61195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/libs/ReportUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5911,12 +5911,18 @@ function buildOptimisticIOUReportAction(params: BuildOptimisticIOUReportActionPa
// IOUs of type split only exist in group DMs and those don't have an iouReport so we need to delete the IOUReportID key
if (type === CONST.IOU.REPORT_ACTION_TYPE.SPLIT) {
delete originalMessage.IOUReportID;
}

if (type !== CONST.IOU.REPORT_ACTION_TYPE.PAY) {
// Split expense made from a policy expense chat only have the payee's accountID as the participant because the payer could be any policy admin
if (isOwnPolicyExpenseChat) {
if (isOwnPolicyExpenseChat && type === CONST.IOU.REPORT_ACTION_TYPE.SPLIT) {
originalMessage.participantAccountIDs = currentUserAccountID ? [currentUserAccountID] : [];
} else {
originalMessage.participantAccountIDs = currentUserAccountID
? [currentUserAccountID, ...participants.map((participant) => participant.accountID ?? CONST.DEFAULT_NUMBER_ID)]
? [
currentUserAccountID,
...participants.filter((participant) => participant.accountID !== currentUserAccountID).map((participant) => participant.accountID ?? CONST.DEFAULT_NUMBER_ID),
]
: participants.map((participant) => participant.accountID ?? CONST.DEFAULT_NUMBER_ID);
}
}
Expand Down