commit 9de6a55bce956b3b65941f632be379d8dc5e8179
parent b3acb12973dde64acb9484c650f50e5336c9b47a
Author: Dan Stillman <dstillman@zotero.org>
Date: Thu, 11 May 2017 01:25:39 -0400
Better approach to opening files after on-demand downloads
Follow-up to 44507ce20b
Diffstat:
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js
@@ -4117,9 +4117,8 @@ var ZoteroPane = new function()
return;
}
- let downloadedItem = item;
try {
- yield Zotero.Sync.Runner.downloadFile(downloadedItem);
+ yield Zotero.Sync.Runner.downloadFile(item);
}
catch (e) {
// TODO: show error somewhere else
@@ -4128,10 +4127,8 @@ var ZoteroPane = new function()
return;
}
- if (!(yield downloadedItem.getFilePathAsync())) {
- ZoteroPane_Local.showAttachmentNotFoundDialog(
- downloadedItem.id, noLocateOnMissing, true
- );
+ if (!(yield item.getFilePathAsync())) {
+ ZoteroPane_Local.showAttachmentNotFoundDialog(item.id, noLocateOnMissing, true);
return;
}
@@ -4139,9 +4136,8 @@ var ZoteroPane = new function()
// maybe not necessary, since we'll get an error if there's an error
Zotero.Notifier.trigger('redraw', 'item', []);
- setTimeout(() => {
- ZoteroPane_Local.viewAttachment(downloadedItem.id, event, false, forceExternalViewer);
- });
+ // Retry after download
+ i--;
}
}
}));