From 281da55217ef1a9933bc464f393bcf857e74ff3a Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Mon, 10 Mar 2025 12:20:03 -0400 Subject: [PATCH] Use is*Attachment() in attachmentReaderType getter --- chrome/content/zotero/xpcom/data/item.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js index b917e23561..2790a64876 100644 --- a/chrome/content/zotero/xpcom/data/item.js +++ b/chrome/content/zotero/xpcom/data/item.js @@ -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; } });