Skip to content

Commit 587d411

Browse files
authored
Merge pull request #61195 from FitseTLT/fix-split-avatar-not-optimistically-set
Fix - Split - Missing user avatars above amount in expense preview when expense is split offline
2 parents 92cce59 + 04c1029 commit 587d411

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/libs/ReportUtils.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -5969,12 +5969,18 @@ function buildOptimisticIOUReportAction(params: BuildOptimisticIOUReportActionPa
59695969
// IOUs of type split only exist in group DMs and those don't have an iouReport so we need to delete the IOUReportID key
59705970
if (type === CONST.IOU.REPORT_ACTION_TYPE.SPLIT) {
59715971
delete originalMessage.IOUReportID;
5972+
}
5973+
5974+
if (type !== CONST.IOU.REPORT_ACTION_TYPE.PAY) {
59725975
// 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
5973-
if (isOwnPolicyExpenseChat) {
5976+
if (isOwnPolicyExpenseChat && type === CONST.IOU.REPORT_ACTION_TYPE.SPLIT) {
59745977
originalMessage.participantAccountIDs = currentUserAccountID ? [currentUserAccountID] : [];
59755978
} else {
59765979
originalMessage.participantAccountIDs = currentUserAccountID
5977-
? [currentUserAccountID, ...participants.map((participant) => participant.accountID ?? CONST.DEFAULT_NUMBER_ID)]
5980+
? [
5981+
currentUserAccountID,
5982+
...participants.filter((participant) => participant.accountID !== currentUserAccountID).map((participant) => participant.accountID ?? CONST.DEFAULT_NUMBER_ID),
5983+
]
59785984
: participants.map((participant) => participant.accountID ?? CONST.DEFAULT_NUMBER_ID);
59795985
}
59805986
}

0 commit comments

Comments
 (0)