From c73f51faef81633a9b216d6bd35daa8c32912eb5 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Mon, 28 Dec 2020 00:19:23 -0500 Subject: [PATCH] Always await callback in ZoteroPane.viewAttachment() The recent change to sniff for PDFs when an attachment didn't have a content type resulted in a ZoteroPane test failing, because a stub for Zotero.launchFile() wouldn't be called by the time the viewAttachment() promise resolved. --- chrome/content/zotero/zoteroPane.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index 655e21ae7d..a3c061ccf0 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -4206,7 +4206,7 @@ var ZoteroPane = new function() if (fileExists && !redownload) { Zotero.debug("Opening " + path); Zotero.Notifier.trigger('open', 'file', item.id); - launchFile(path, item.attachmentContentType, item.id); + await launchFile(path, item.attachmentContentType, item.id); continue; } @@ -4252,7 +4252,7 @@ var ZoteroPane = new function() Zotero.debug("Opening " + path); Zotero.Notifier.trigger('open', 'file', item.id); - launchFile(path, item.attachmentContentType, item.id); + await launchFile(path, item.attachmentContentType, item.id); } });