From 90fe533b8830d223f6478837edc26dab93381af1 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Sat, 13 Jul 2024 11:33:34 +0800 Subject: [PATCH] lint --- src/pages/ReportDetailsPage.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/pages/ReportDetailsPage.tsx b/src/pages/ReportDetailsPage.tsx index 031f2f9ebbdf..288f6c241be3 100644 --- a/src/pages/ReportDetailsPage.tsx +++ b/src/pages/ReportDetailsPage.tsx @@ -753,12 +753,14 @@ function ReportDetailsPage({policies, report, session, personalDetails}: ReportD onCancel={() => setIsDeleteModalVisible(false)} onModalHide={() => { // We use isTransactionDeleted to know if the modal hides because the user deletes the transaction. - if (isTransactionDeleted.current) { - if (!navigateBackToAfterDelete.current) { - Navigation.dismissModal(); - } else { - ReportUtils.navigateBackAfterDeleteTransaction(navigateBackToAfterDelete.current); - } + if (!isTransactionDeleted.current) { + return; + } + + if (!navigateBackToAfterDelete.current) { + Navigation.dismissModal(); + } else { + ReportUtils.navigateBackAfterDeleteTransaction(navigateBackToAfterDelete.current); } }} prompt={caseID === CASES.DEFAULT ? translate('task.deleteConfirmation') : translate('iou.deleteConfirmation')}