Avoid error interrupting annotation extraction from multiple items

This commit is contained in:
Martynas Bagdonas 2022-05-16 13:33:52 +03:00 committed by Dan Stillman
parent 477dd69d54
commit b98a5e0545
3 changed files with 14 additions and 8 deletions

View file

@ -437,9 +437,11 @@ var ZoteroContextPane = new function () {
if (!attachment) {
return;
}
var note = await Zotero.EditorInstance.createNoteFromAnnotations(
attachment.getAnnotations().filter(x => x.annotationType != 'ink'), child && attachment.parentID
);
var annotations = attachment.getAnnotations().filter(x => x.annotationType != 'ink');
if (!annotations.length) {
return;
}
var note = await Zotero.EditorInstance.createNoteFromAnnotations(annotations, child && attachment.parentID);
_updateAddToNote();

View file

@ -4824,9 +4824,11 @@ var ZoteroPane = new function()
return;
}
await Zotero.PDFWorker.import(attachment.id, true);
var note = await Zotero.EditorInstance.createNoteFromAnnotations(
attachment.getAnnotations().filter(x => x.annotationType != 'ink'), attachment.parentID
);
var annotations = attachment.getAnnotations().filter(x => x.annotationType != 'ink');
if (!annotations.length) {
return;
}
var note = await Zotero.EditorInstance.createNoteFromAnnotations(annotations, attachment.parentID);
if (!skipSelect) {
await this.selectItem(note.id);
}
@ -4864,7 +4866,9 @@ var ZoteroPane = new function()
attachment,
{ skipSelect: true }
);
itemIDsToSelect.push(note.id);
if (note) {
itemIDsToSelect.push(note.id);
}
}
}
await this.selectItems(itemIDsToSelect);

@ -1 +1 @@
Subproject commit 1a3fa7b30df0a1530d49042a308e0840ac907f1a
Subproject commit fb3daf6c7e1d7a91992deeea52889cb9c95972f7