Skip to content

Commit

Permalink
Fix bulk import flow in Knowledge Base by awaiting async mutation and…
Browse files Browse the repository at this point in the history
… ensuring onClose is called correctly
  • Loading branch information
arturoliduena committed Jan 3, 2025
1 parent b3be6ed commit 10a76b0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export function KnowledgeBaseBulkImportFlyout({ onClose }: { onClose: () => void

try {
entries = elements.map((el) => JSON.parse(el));
mutateAsync({ entries }).then(onClose);
await mutateAsync({ entries });
} catch (_) {
toasts.addError(
new Error(
Expand All @@ -74,8 +74,8 @@ export function KnowledgeBaseBulkImportFlyout({ onClose }: { onClose: () => void
),
}
);
onClose();
}
onClose();
};

return (
Expand Down

0 comments on commit 10a76b0

Please sign in to comment.