From 93226577f338265f91d3d4773f622887d54709f3 Mon Sep 17 00:00:00 2001 From: Uladzislau_Kutarkin Date: Mon, 11 Sep 2023 19:36:28 +0400 Subject: [PATCH] UIBULKED-312: fix duplicate --- .../BulkEditManualUploadModal.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/components/BulkEditList/BulkEditListResult/BulkEditManualUploadModal/BulkEditManualUploadModal.js b/src/components/BulkEditList/BulkEditListResult/BulkEditManualUploadModal/BulkEditManualUploadModal.js index e601beb4..1912f45e 100644 --- a/src/components/BulkEditList/BulkEditListResult/BulkEditManualUploadModal/BulkEditManualUploadModal.js +++ b/src/components/BulkEditList/BulkEditListResult/BulkEditManualUploadModal/BulkEditManualUploadModal.js @@ -85,9 +85,9 @@ const BulkEditManualUploadModal = ({ setCurrentStep(MANUAL_UPLOAD_STEPS.CONFIRM); }; - const handleCancel = () => { + const handleCancel = (isCancel = true) => { if (controller.current) controller.current.abort(); - if (fileName) bulkOperationDelete({ operationId }); + if (fileName && isCancel) bulkOperationDelete({ operationId }); setCurrentStep(MANUAL_UPLOAD_STEPS.UPLOAD); setFileName(''); @@ -112,9 +112,7 @@ const BulkEditManualUploadModal = ({ } catch { swwCallout(swwErrorMessage); } finally { - setCurrentStep(MANUAL_UPLOAD_STEPS.UPLOAD); - setFileName(''); - onCancel(); + handleCancel(false); } };