fix(export): maintain same order of attachments

pull/1393/head
Elian Doran 2025-03-11 18:27:08 +07:00
parent bb288c5c68
commit f86434523e
No known key found for this signature in database
1 changed files with 3 additions and 1 deletions

@ -182,7 +182,9 @@ async function exportToZip(taskContext: TaskContext, branch: BBranch, format: "h
} }
const attachments = note.getAttachments(); 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 = { const attMeta: AttachmentMeta = {
attachmentId: attachment.attachmentId, attachmentId: attachment.attachmentId,
title: attachment.title, title: attachment.title,