Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
fix(edit-docs): preserve attachment IDs
Elian Dorand134ee0552d6
diff --git a/src/services/import/zip.ts b/src/services/import/zip.tsindex 9cf943006f..3f7d1ef8e2 100644--- a/src/services/import/zip.ts+++ b/src/services/import/zip.ts@@ -62,6 +62,10 @@ async function importZip(taskContext: TaskContext, fileBuffer: Buffer, importRoo}function getNewAttachmentId(origAttachmentId: string) {+ if (opts?.preserveIds) {+ return origAttachmentId;+ }+if (!origAttachmentId.trim()) {// this probably shouldn't happen, but still good to have this precautionreturn "empty_attachment_id";