www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit c51290641da90ea44cedc188ce8ac12af44fd985
parent 86504b24244293913b7987624b7c0229bcf4ea32
Author: Dan Stillman <dstillman@zotero.org>
Date:   Mon, 28 Mar 2011 00:05:29 +0000

Prevent auto-sync attempt when switching pane/tab mode shortly after pane/tab open if a sync is already running


Diffstat:
Mchrome/content/zotero/zoteroPane.js | 26++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js @@ -387,16 +387,22 @@ var ZoteroPane = new function() Zotero.debug("Purged data tables in " + (d2 - d) + " ms"); // Auto-sync on pane open - if (Zotero.Prefs.get('sync.autoSync') && Zotero.Sync.Server.enabled - && !Zotero.Sync.Server.syncInProgress && !Zotero.Sync.Storage.syncInProgress) { - if (Zotero.Sync.Server.manualSyncRequired) { - Zotero.debug('Manual sync required -- skipping auto-sync', 4); - } - else { - setTimeout(function () { - Zotero.Sync.Runner.sync(true); - }, 1000); - } + if (Zotero.Prefs.get('sync.autoSync')) { + setTimeout(function () { + if (!Zotero.Sync.Server.enabled + || Zotero.Sync.Server.syncInProgress + || Zotero.Sync.Storage.syncInProgress) { + Zotero.debug('Sync already running -- skipping auto-sync', 4); + return; + } + + if (Zotero.Sync.Server.manualSyncRequired) { + Zotero.debug('Manual sync required -- skipping auto-sync', 4); + return; + } + + Zotero.Sync.Runner.sync(true); + }, 1000); } return true;