From 1380e653c92ae2546ed5a19a4dd5a610d67eab37 Mon Sep 17 00:00:00 2001 From: Alberto Date: Wed, 14 Feb 2024 10:21:06 +0100 Subject: [PATCH] style --- src/components/MoneyReportHeader.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/MoneyReportHeader.tsx b/src/components/MoneyReportHeader.tsx index 815dea19a0a8..3f551da788f5 100644 --- a/src/components/MoneyReportHeader.tsx +++ b/src/components/MoneyReportHeader.tsx @@ -67,10 +67,11 @@ function MoneyReportHeader({session, policy, chatReport, nextStep, report: money const [isConfirmModalVisible, setIsConfirmModalVisible] = useState(false); const cancelPayment = useCallback(() => { - if (chatReport) { - IOU.cancelPayment(moneyRequestReport, chatReport); - setIsConfirmModalVisible(false); + if (!chatReport) { + return; } + IOU.cancelPayment(moneyRequestReport, chatReport); + setIsConfirmModalVisible(false); }, [moneyRequestReport, chatReport]); const isOnInstantSubmitPolicy = PolicyUtils.isInstantSubmitEnabled(policy);