From 44507ce20b278c97f243f3d05e15e69749180bde Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 11 May 2017 01:05:55 -0400 Subject: [PATCH] Prevent conflicting file downloads on double double-click --- chrome/content/zotero/zoteroPane.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index c3954cde50..aee8be7342 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -4053,7 +4053,7 @@ var ZoteroPane = new function() }); - this.viewAttachment = Zotero.Promise.coroutine(function* (itemIDs, event, noLocateOnMissing, forceExternalViewer) { + this.viewAttachment = Zotero.serial(Zotero.Promise.coroutine(function* (itemIDs, event, noLocateOnMissing, forceExternalViewer) { // If view isn't editable, don't show Locate button, since the updated // path couldn't be sent back up if (!this.collectionsView.editable) { @@ -4138,14 +4138,13 @@ var ZoteroPane = new function() // check if unchanged? // maybe not necessary, since we'll get an error if there's an error - Zotero.Notifier.trigger('redraw', 'item', []); - Zotero.debug('downloaded'); - Zotero.debug(downloadedItem.id); - return ZoteroPane_Local.viewAttachment(downloadedItem.id, event, false, forceExternalViewer); + setTimeout(() => { + ZoteroPane_Local.viewAttachment(downloadedItem.id, event, false, forceExternalViewer); + }); } } - }); + })); /**