From 64143d99e82644b4dc7a61b9747b5fed5e02560a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Ch=C3=A1vez?= Date: Thu, 19 Oct 2023 17:05:38 -0600 Subject: [PATCH] DRY isPolicyExpenseChat value --- src/pages/iou/steps/MoneyRequestConfirmPage.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pages/iou/steps/MoneyRequestConfirmPage.js b/src/pages/iou/steps/MoneyRequestConfirmPage.js index 5edd6f63fb10..f5027e3cef77 100644 --- a/src/pages/iou/steps/MoneyRequestConfirmPage.js +++ b/src/pages/iou/steps/MoneyRequestConfirmPage.js @@ -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], );