From f86434523e8a2c4628f504fb6b9184f43525ec93 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Tue, 11 Mar 2025 18:27:08 +0200 Subject: [PATCH] fix(export): maintain same order of attachments --- src/services/export/zip.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/services/export/zip.ts b/src/services/export/zip.ts index a21572b04..0a4903fd6 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,