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.
This commit is contained in:
parent
1f2408a9c5
commit
c73f51faef
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue