Import external annotations before trying to add a note from annotations

(cherry picked from commit 9691fcafc2)
This commit is contained in:
Martynas Bagdonas 2022-09-30 09:40:35 +03:00
parent 61c0dfee38
commit 764d1b006e

View file

@ -5032,6 +5032,12 @@ var ZoteroPane = new function()
var annotations = [];
for (let attachment of attachments) {
try {
await Zotero.PDFWorker.import(attachment.id, true);
}
catch (e) {
Zotero.logError(e);
}
annotations.push(...attachment.getAnnotations());
}
var note = await Zotero.EditorInstance.createNoteFromAnnotations(
@ -5122,6 +5128,12 @@ var ZoteroPane = new function()
continue;
}
for (let attachment of attachments) {
try {
await Zotero.PDFWorker.import(attachment.id, true);
}
catch (e) {
Zotero.logError(e);
}
annotations.push(...attachment.getAnnotations());
}
}