Use is*Attachment() in attachmentReaderType getter

This commit is contained in:
Abe Jellinek 2025-03-10 12:20:03 -04:00
parent fb9aab3bb0
commit 281da55217

View file

@ -3208,16 +3208,16 @@ Zotero.defineProperty(Zotero.Item.prototype, 'attachmentReaderType', {
if (!this.isFileAttachment()) {
return undefined;
}
switch (this.attachmentContentType) {
case 'application/pdf':
return 'pdf';
case 'application/epub+zip':
return 'epub';
case 'text/html':
return 'snapshot';
default:
return undefined;
if (this.isPDFAttachment()) {
return 'pdf';
}
else if (this.isEPUBAttachment()) {
return 'epub';
}
else if (this.isSnapshotAttachment()) {
return 'snapshot';
}
return undefined;
}
});