Skip to content

Build your personal knowledge base with Trilium Notes

correct placement of imported root note (at the end)

zadamd9053359356e
diff --git a/src/services/import/zip.js b/src/services/import/zip.js
index 4625af84f7..1889b27086 100644
--- a/src/services/import/zip.js
+++ b/src/services/import/zip.js
@@ -355,7 +355,9 @@ async function importZip(taskContext, fileBuffer, importRootNote) {
mime,
prefix: noteMeta ? noteMeta.prefix : '',
isExpanded: noteMeta ? noteMeta.isExpanded : false,
- notePosition: noteMeta ? noteMeta.notePosition : false,
+ // root notePosition should be ignored since it relates to original document
+ // now import root should be placed after existing notes into new parent
+ notePosition: (noteMeta && firstNote) ? noteMeta.notePosition : undefined,
isProtected: importRootNote.isProtected && protectedSessionService.isProtectedSessionAvailable(),
}));