From fd7c2a6f6f163ac5500a1655e567161ddf29cfb1 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 11 Jul 2017 02:42:00 -0400 Subject: [PATCH] Try harder to prevent sync-in-progress messages --- chrome/content/zotero/xpcom/sync/syncRunner.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/chrome/content/zotero/xpcom/sync/syncRunner.js b/chrome/content/zotero/xpcom/sync/syncRunner.js index 1c2c7e32d3..5cab5de5e6 100644 --- a/chrome/content/zotero/xpcom/sync/syncRunner.js +++ b/chrome/content/zotero/xpcom/sync/syncRunner.js @@ -119,12 +119,12 @@ Zotero.Sync.Runner_Module = function (options = {}) { _syncInProgress = true; _stopping = false; - yield Zotero.Notifier.trigger('start', 'sync', []); - - // Purge deleted objects so they don't cause sync errors (e.g., long tags) - yield Zotero.purgeDataObjects(true); - try { + yield Zotero.Notifier.trigger('start', 'sync', []); + + // Purge deleted objects so they don't cause sync errors (e.g., long tags) + yield Zotero.purgeDataObjects(true); + let apiKey = yield _getAPIKey(); if (!apiKey) { throw new Zotero.Error("API key not set", Zotero.Error.ERROR_API_KEY_NOT_SET); @@ -801,12 +801,12 @@ Zotero.Sync.Runner_Module = function (options = {}) { this.end = Zotero.Promise.coroutine(function* (options) { + _syncInProgress = false; yield this.checkErrors(_errors, options); if (!options.restartSync) { this.updateIcons(_errors); } _errors = []; - _syncInProgress = false; });