Fix imports with missing attachments not closing progress window. Closes #1583
This commit is contained in:
parent
6bf31b274f
commit
f7e9067660
1 changed files with 5 additions and 5 deletions
|
@ -196,9 +196,10 @@ Zotero.Translate.ItemSaver.prototype = {
|
||||||
// possible downloads.
|
// possible downloads.
|
||||||
//
|
//
|
||||||
// TODO: Separate pref?
|
// TODO: Separate pref?
|
||||||
|
var shouldDownloadOAPDF = this.attachmentMode == Zotero.Translate.ItemSaver.ATTACHMENT_MODE_DOWNLOAD
|
||||||
|
&& Zotero.Prefs.get('downloadAssociatedFiles');
|
||||||
var openAccessPDFURLs = new Map();
|
var openAccessPDFURLs = new Map();
|
||||||
if (this.attachmentMode == Zotero.Translate.ItemSaver.ATTACHMENT_MODE_DOWNLOAD
|
if (shouldDownloadOAPDF) {
|
||||||
&& Zotero.Prefs.get('downloadAssociatedFiles')) {
|
|
||||||
for (let item of items) {
|
for (let item of items) {
|
||||||
let jsonItem = jsonByItem.get(item);
|
let jsonItem = jsonByItem.get(item);
|
||||||
|
|
||||||
|
@ -239,7 +240,7 @@ Zotero.Translate.ItemSaver.prototype = {
|
||||||
parentItemID,
|
parentItemID,
|
||||||
function (attachment, progress, error) {
|
function (attachment, progress, error) {
|
||||||
// Don't cancel failed primary PDFs until we've tried other methods
|
// Don't cancel failed primary PDFs until we've tried other methods
|
||||||
if (progress === false && attachment.isPrimaryPDF) {
|
if (progress === false && attachment.isPrimaryPDF && shouldDownloadOAPDF) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
attachmentCallback(...arguments);
|
attachmentCallback(...arguments);
|
||||||
|
@ -252,8 +253,7 @@ Zotero.Translate.ItemSaver.prototype = {
|
||||||
|
|
||||||
// If a translated PDF attachment wasn't saved successfully, either because there wasn't
|
// If a translated PDF attachment wasn't saved successfully, either because there wasn't
|
||||||
// one or there was but it failed, look for another PDF (if enabled)
|
// one or there was but it failed, look for another PDF (if enabled)
|
||||||
if (this.attachmentMode == Zotero.Translate.ItemSaver.ATTACHMENT_MODE_DOWNLOAD
|
if (shouldDownloadOAPDF) {
|
||||||
&& Zotero.Prefs.get('downloadAssociatedFiles')) {
|
|
||||||
for (let item of items) {
|
for (let item of items) {
|
||||||
// Already have a PDF from translation
|
// Already have a PDF from translation
|
||||||
if (itemIDsWithPDFAttachments.has(item.id)) {
|
if (itemIDsWithPDFAttachments.has(item.id)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue