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(export): maintain same order of attachments
Elian Doranf86434523e8a
diff --git a/src/services/export/zip.ts b/src/services/export/zip.tsindex a21572b044..0a4903fd62 100644--- a/src/services/export/zip.ts+++ b/src/services/export/zip.ts@@ -182,7 +182,9 @@ async function exportToZip(taskContext: TaskContext, branch: BBranch, format: "h}const attachments = note.getAttachments();- meta.attachments = attachments.map((attachment) => {+ meta.attachments = attachments+ .toSorted((a, b) => ((a.attachmentId ?? "").localeCompare(b.attachmentId ?? "", "en") ?? 1))+ .map((attachment) => {const attMeta: AttachmentMeta = {attachmentId: attachment.attachmentId,title: attachment.title,