From 668e0b7d0a377c09085a87d9bc9ce76f591b2867 Mon Sep 17 00:00:00 2001 From: Majid Date: Thu, 2 Nov 2023 22:33:41 +0100 Subject: [PATCH] fix: correctly setting up the billable value of IOU --- src/pages/iou/steps/MoneyRequestConfirmPage.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pages/iou/steps/MoneyRequestConfirmPage.js b/src/pages/iou/steps/MoneyRequestConfirmPage.js index 3a12a4da4e59..54a84f99fa55 100644 --- a/src/pages/iou/steps/MoneyRequestConfirmPage.js +++ b/src/pages/iou/steps/MoneyRequestConfirmPage.js @@ -93,12 +93,13 @@ function MoneyRequestConfirmPage(props) { if (policyExpenseChat) { Policy.openDraftWorkspaceRequest(policyExpenseChat.policyID); } - // Verification to reset billable with a default value, when value in IOU was changed - if (typeof props.iou.billable !== 'boolean') { - IOU.setMoneyRequestBillable(lodashGet(props.policy, 'defaultBillable', false)); - } }, [isOffline, participants, props.iou.billable, props.policy]); + const defaultBillable = lodashGet(props.policy, 'defaultBillable', false); + useEffect(() => { + IOU.setMoneyRequestBillable(defaultBillable); + }, [defaultBillable, isOffline]); + useEffect(() => { if (!props.iou.receiptPath || !props.iou.receiptFilename) { return;