Fix auto-sync timeout in notes

Regression in 7ace5ea29
This commit is contained in:
Dan Stillman 2021-05-14 05:13:19 -04:00
parent 53f53779a3
commit 6834c6062b
3 changed files with 8 additions and 4 deletions

View file

@ -927,8 +927,8 @@ Zotero.DataObject.prototype.save = Zotero.Promise.coroutine(function* (options =
}
// Pass along event-level notifier options, which become top-level extraData properties
for (let option of Zotero.Notifier.EVENT_LEVEL_OPTIONS) {
if (env.options[option]) {
env.notifierData[option] = true;
if (env.options[option] !== undefined) {
env.notifierData[option] = env.options[option];
}
}
if (!env.isNew) {

View file

@ -206,8 +206,8 @@ Zotero.Notifier = new function(){
if (extraData) {
// Set event-level options as top-level properties in extraData
for (let option of Zotero.Notifier.EVENT_LEVEL_OPTIONS) {
if (extraData[option]) {
queue[type][event].data[option] = true;
if (extraData[option] !== undefined) {
queue[type][event].data[option] = extraData[option];
delete extraData[option];
}
}

View file

@ -936,6 +936,10 @@ Zotero.Sync.Runner_Module = function (options = {}) {
throw new Error("Timeout not provided");
}
if (timeout != parseInt(timeout)) {
throw new Error(`Timeout must be an integer (${timeout} given)`);
}
if (_autoSyncTimer) {
Zotero.debug("Cancelling auto-sync timer");
_autoSyncTimer.cancel();