Skip to content

Commit

Permalink
DRY isPolicyExpenseChat value
Browse files Browse the repository at this point in the history
  • Loading branch information
marcochavezf committed Oct 19, 2023
1 parent 3b7b608 commit 64143d9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/pages/iou/steps/MoneyRequestConfirmPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@ function MoneyRequestConfirmPage(props) {
_.chain(props.iou.participants)
.map((participant) => {
const isPolicyExpenseChat = lodashGet(participant, 'isPolicyExpenseChat', false);
return isPolicyExpenseChat ? OptionsListUtils.getPolicyExpenseReportOption(participant) : OptionsListUtils.getParticipantsOption(participant, props.personalDetails);
})
.filter((participant) => {
const isPolicyExpenseChat = lodashGet(participant, 'isPolicyExpenseChat', false);
return isPolicyExpenseChat || !!participant.login;
const option = isPolicyExpenseChat
? OptionsListUtils.getPolicyExpenseReportOption(participant)
: OptionsListUtils.getParticipantsOption(participant, props.personalDetails);
return { ...option, isPolicyExpenseChat };
})
.filter((option) => option.isPolicyExpenseChat || !!option.login)
.value(),
[props.iou.participants, props.personalDetails],
);
Expand Down

0 comments on commit 64143d9

Please sign in to comment.