Skip to content

Build your personal knowledge base with Trilium Notes

fix(edit-docs): preserve attachment IDs

Elian Dorand134ee0552d6
diff --git a/src/services/import/zip.ts b/src/services/import/zip.ts
index 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 precaution
return "empty_attachment_id";