Don't auto-select item after sync on upload error

Bug from 2017
This commit is contained in:
Dan Stillman 2025-01-22 03:13:19 -05:00
parent e3387bbe96
commit 8642091d8e

View file

@ -913,14 +913,25 @@ Zotero.Sync.Runner_Module = function (options = {}) {
}
this.end = Zotero.Promise.coroutine(function* (options) {
this.end = async function (options) {
_syncInProgress = false;
yield this.checkErrors(_errors, options);
await this.checkErrors(_errors, options);
if (!options.restartSync) {
this.updateIcons(_errors);
// If foreground sync, trigger dialog button immediately for some errors
// (e.g., long tag fixer)
if (!options.background && _errors.length) {
if (_errors[0].dialogButtonImmediate) {
let maybePromise = _errors[0].dialogButtonCallback();
if (maybePromise && maybePromise.then) {
await maybePromise;
}
}
}
}
_errors = [];
});
};
/**
@ -1253,6 +1264,7 @@ Zotero.Sync.Runner_Module = function (options = {}) {
options.restartSync = true;
});
e.dialogButtonImmediate = true;
}
else {
// Note too long
@ -1296,14 +1308,6 @@ Zotero.Sync.Runner_Module = function (options = {}) {
};
}
}
// If not a background sync, show dialog immediately
if (!options.background && e.dialogButtonCallback) {
let maybePromise = e.dialogButtonCallback();
if (maybePromise && maybePromise.then) {
yield maybePromise;
}
}
}
}
// Show warning for unknown data that couldn't be saved