diff --git a/packages/console/src/components/UnsavedChangesAlertModal/index.tsx b/packages/console/src/components/UnsavedChangesAlertModal/index.tsx index 61329650c..0920c6b12 100644 --- a/packages/console/src/components/UnsavedChangesAlertModal/index.tsx +++ b/packages/console/src/components/UnsavedChangesAlertModal/index.tsx @@ -7,9 +7,10 @@ import ConfirmModal from '@/ds-components/ConfirmModal'; type Props = { hasUnsavedChanges: boolean; parentPath?: string; + onConfirm?: () => void; }; -function UnsavedChangesAlertModal({ hasUnsavedChanges, parentPath }: Props) { +function UnsavedChangesAlertModal({ hasUnsavedChanges, parentPath, onConfirm }: Props) { const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' }); const { pathname } = useLocation(); const blocker = useBlocker(hasUnsavedChanges); @@ -36,7 +37,10 @@ function UnsavedChangesAlertModal({ hasUnsavedChanges, parentPath }: Props) { confirmButtonText="general.leave_page" cancelButtonText="general.stay_on_page" onCancel={blocker.reset} - onConfirm={blocker.proceed} + onConfirm={() => { + onConfirm?.(); + blocker.proceed?.(); + }} > {t('general.unsaved_changes_warning')} diff --git a/packages/console/src/pages/ApplicationDetails/index.tsx b/packages/console/src/pages/ApplicationDetails/index.tsx index ebba628a4..fd0d74470 100644 --- a/packages/console/src/pages/ApplicationDetails/index.tsx +++ b/packages/console/src/pages/ApplicationDetails/index.tsx @@ -259,7 +259,7 @@ function ApplicationDetails() { )} - + ); }