Skip to content

Commit 6de77ff

Browse files
trangdoan982claude
andcommitted
ENG-2084 Use onWarning callback in applySchemaImportSelection
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent b3f4acd commit 6de77ff

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

apps/obsidian/src/components/ImportSpecsModal.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,24 +67,21 @@ const ImportPreviewSelection = ({
6767
}
6868

6969
setIsApplyingImport(true);
70+
const warnings: string[] = [];
7071
try {
71-
const result = await applySchemaImportSelection({
72+
const { created } = await applySchemaImportSelection({
7273
plugin,
7374
loadedSchemaFile,
7475
selection: selected,
76+
onWarning: (message) => warnings.push(message),
7577
});
7678

77-
const { created } = result;
7879
new Notice(
7980
`Import complete: ${created.nodeTypes} node type(s), ${created.relationTypes} relation type(s), ${created.discourseRelations} relation triple(s), and ${created.templates} template(s) created.`,
8081
7000,
8182
);
82-
83-
if (result.warnings.length > 0) {
84-
new Notice(
85-
`Import warnings:\n${result.warnings.join("\n")}`,
86-
6000,
87-
);
83+
if (warnings.length > 0) {
84+
new Notice(`Import warnings:\n${warnings.join("\n")}`, 6000);
8885
}
8986
onClose();
9087
} catch (error) {

0 commit comments

Comments
 (0)