diff --git a/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/knowledge_base_bulk_import_flyout.tsx b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/knowledge_base_bulk_import_flyout.tsx index 23d5ad00af12a..0d02434b0b80d 100644 --- a/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/knowledge_base_bulk_import_flyout.tsx +++ b/x-pack/solutions/observability/plugins/observability_ai_assistant_management/public/routes/components/knowledge_base_bulk_import_flyout.tsx @@ -54,6 +54,7 @@ export function KnowledgeBaseBulkImportFlyout({ onClose }: { onClose: () => void try { entries = elements.map((el) => JSON.parse(el)); + mutateAsync({ entries }).then(onClose); } catch (_) { toasts.addError( new Error( @@ -73,9 +74,8 @@ export function KnowledgeBaseBulkImportFlyout({ onClose }: { onClose: () => void ), } ); + onClose(); } - - mutateAsync({ entries }).then(onClose); }; return (