Better approach to opening files after on-demand downloads
Follow-up to 44507ce20b
This commit is contained in:
parent
b3acb12973
commit
9de6a55bce
1 changed files with 5 additions and 9 deletions
|
@ -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--;
|
||||
}
|
||||
}
|
||||
}));
|
||||
|
|
Loading…
Add table
Reference in a new issue