Skip to content
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

[IOU Split Bill] Use participants optimistically #18656

Merged
merged 2 commits into from
May 10, 2023
Merged
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1159,6 +1159,11 @@ function buildOptimisticIOUReportAction(type, amount, currency, comment, partici
// 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;
const participantLogins = [currentUserEmail];
_.each(participants, (participant) => {
participantLogins.push(participant.login);
});
originalMessage.participants = participantLogins;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const participantLogins = [currentUserEmail];
_.each(participants, (participant) => {
participantLogins.push(participant.login);
});
originalMessage.participants = participantLogins;
originalMessage.participants = [currentUserEmail, ..._.pluck(participants, 'login')];

NAB: Just a simplification.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@s77rt oooo this is v v nice, updated

}

return {
Expand Down