Don't suggest to create note if only ink annotations exist

This commit is contained in:
Martynas Bagdonas 2021-10-26 16:56:15 +03:00
parent 3ed23e5cce
commit cdb826e358

View file

@ -2865,7 +2865,7 @@ var ZoteroPane = new function()
popup.textContent = '';
let eligibleAttachments = Zotero.Items.get(item.getAttachments())
.filter(item => item.isPDFAttachment());
let attachmentsWithAnnotations = eligibleAttachments.filter(x => x.numAnnotations());
let attachmentsWithAnnotations = eligibleAttachments.filter(x => x.getAnnotations().some(x => x.annotationType != 'ink'));
if (attachmentsWithAnnotations.length) {
// Display submenu if there's more than one PDF attachment, even if
// there's only attachment with annotations, so it's clear which one
@ -4429,7 +4429,7 @@ var ZoteroPane = new function()
var attachment;
if (item.isRegularItem()) {
attachment = Zotero.Items.get(item.getAttachments())
.find(x => x.isPDFAttachment() && x.numAnnotations());
.find(x => x.isPDFAttachment() && x.getAnnotations().some(x => x.annotationType != 'ink'));
}
else if (item.isFileAttachment()) {
attachment = item;