commit 26dcaad76aa83bed541658b7ecf44a17adff5447 parent 97661539dce3f485a311fb9eb61626c684705d83 Author: Dan Stillman <dstillman@zotero.org> Date: Thu, 1 Mar 2018 00:07:38 -0500 Don't show Reindex button for files that aren't PDFs or text files Diffstat:
| M | chrome/content/zotero/xpcom/fulltext.js | | | 7 | ++++++- |
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/chrome/content/zotero/xpcom/fulltext.js b/chrome/content/zotero/xpcom/fulltext.js @@ -1347,7 +1347,12 @@ Zotero.Fulltext = Zotero.FullText = new function(){ * Item must be a non-web-link attachment that isn't already fully indexed */ this.canReindex = Zotero.Promise.coroutine(function* (item) { - if (item.isAttachment() && item.attachmentLinkMode != Zotero.Attachments.LINK_MODE_LINKED_URL) { + if (item.isAttachment() + && item.attachmentLinkMode != Zotero.Attachments.LINK_MODE_LINKED_URL) { + let contentType = item.attachmentContentType; + if (!contentType || contentType != 'application/pdf' && !Zotero.MIME.isTextType(contentType)) { + return false; + } switch (yield this.getIndexedState(item)) { case this.INDEX_STATE_UNAVAILABLE: case this.INDEX_STATE_UNINDEXED: