Skip to content

Commit

Permalink
fix selectedParticipants;
Browse files Browse the repository at this point in the history
  • Loading branch information
luacmartins committed Oct 31, 2022
1 parent 2fb6d24 commit d20ea60
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/IOUConfirmationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ class IOUConfirmationList extends Component {
Log.info(`[IOU] Sending money via: ${paymentMethod}`);
this.props.onSendMoney(paymentMethod);
} else {
this.props.onConfirm();
this.props.onConfirm(selectedParticipants);
}
}

Expand Down
11 changes: 7 additions & 4 deletions src/pages/iou/IOUModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,14 +308,17 @@ class IOUModal extends Component {
});
}

createTransaction() {
/**
* @param {Array} selectedParticipants
*/
createTransaction(selectedParticipants) {
const reportID = lodashGet(this.props, 'route.params.reportID', '');

// IOUs created from a group report will have a reportID param in the route.
// Since the user is already viewing the report, we don't need to navigate them to the report
if (this.props.hasMultipleParticipants && CONST.REGEX.NUMBER.test(reportID)) {
IOU.splitBill(
this.state.participants,
selectedParticipants,
this.props.currentUserPersonalDetails.login,
this.state.amount,
this.state.comment,
Expand All @@ -328,7 +331,7 @@ class IOUModal extends Component {
// If the IOU is created from the global create menu, we also navigate the user to the group report
if (this.props.hasMultipleParticipants) {
IOU.splitBillAndOpenReport(
this.state.participants,
selectedParticipants,
this.props.currentUserPersonalDetails.login,
this.state.amount,
this.state.comment,
Expand All @@ -342,7 +345,7 @@ class IOUModal extends Component {
Math.round(this.state.amount * 100),
this.props.iou.selectedCurrencyCode,
this.props.currentUserPersonalDetails.login,
this.state.participants[0],
selectedParticipants[0],
this.state.comment);
}

Expand Down

0 comments on commit d20ea60

Please sign in to comment.