From 4b66ddfdef727d5594e20b1cb4737b3413e20ff5 Mon Sep 17 00:00:00 2001 From: ManishMadan2882 Date: Sat, 24 May 2025 01:19:54 +0530 Subject: [PATCH] (fix:config) use default variant for confirm modal --- frontend/src/settings/ToolConfig.tsx | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/frontend/src/settings/ToolConfig.tsx b/frontend/src/settings/ToolConfig.tsx index 68b68951..de99fabf 100644 --- a/frontend/src/settings/ToolConfig.tsx +++ b/frontend/src/settings/ToolConfig.tsx @@ -421,18 +421,10 @@ export default function ToolConfig({ })} modalState="ACTIVE" setModalState={(state) => setShowUnsavedModal(state === 'ACTIVE')} - submitLabel={t('settings.tools.leaveWithoutSaving', { - defaultValue: 'Leave without Saving', - })} - handleSubmit={() => { - setShowUnsavedModal(false); - handleGoBack(); - }} - cancelLabel={t('settings.tools.saveAndLeave', { + submitLabel={t('settings.tools.saveAndLeave', { defaultValue: 'Save and Leave', })} - handleCancel={() => { - // First save changes, then go back + handleSubmit={() => { userService .updateTool( { @@ -455,7 +447,13 @@ export default function ToolConfig({ handleGoBack(); }); }} - variant="danger" + cancelLabel={t('settings.tools.leaveWithoutSaving', { + defaultValue: 'Leave without Saving', + })} + handleCancel={() => { + setShowUnsavedModal(false); + handleGoBack(); + }} /> )}