diff --git a/chrome/content/zotero/xpcom/sync.js b/chrome/content/zotero/xpcom/sync.js index 9dce984c7..8221f981f 100644 --- a/chrome/content/zotero/xpcom/sync.js +++ b/chrome/content/zotero/xpcom/sync.js @@ -1057,7 +1057,19 @@ Zotero.Sync.Runner.IdleListener = { return; } + // TODO: move to Runner.sync()? + if (Zotero.locked) { + Zotero.debug('Zotero is locked -- skipping idle sync', 4); + return; + } + + if (Zotero.Sync.Server.manualSyncRequired) { + Zotero.debug('Manual sync required -- skipping idle sync', 4); + return; + } + Zotero.debug("Beginning idle sync"); + Zotero.Sync.Runner.sync(true); Zotero.Sync.Runner.setSyncTimeout(this._idleTimeout, true); }, diff --git a/chrome/content/zotero/zoteroPane.js b/chrome/content/zotero/zoteroPane.js index 343998364..c2ee3f936 100644 --- a/chrome/content/zotero/zoteroPane.js +++ b/chrome/content/zotero/zoteroPane.js @@ -411,9 +411,12 @@ var ZoteroPane = new function() // Auto-sync on pane open if (Zotero.Prefs.get('sync.autoSync')) { setTimeout(function () { - if (!Zotero.Sync.Server.enabled - || Zotero.Sync.Server.syncInProgress - || Zotero.Sync.Storage.syncInProgress) { + if (!Zotero.Sync.Server.enabled) { + Zotero.debug('Sync not enabled -- skipping auto-sync', 4); + return; + } + + if (Zotero.Sync.Server.syncInProgress || Zotero.Sync.Storage.syncInProgress) { Zotero.debug('Sync already running -- skipping auto-sync', 4); return; } @@ -433,9 +436,6 @@ var ZoteroPane = new function() if (Zotero.Sync.Server.syncInProgress || Zotero.Sync.Storage.syncInProgress) { Zotero.Sync.Runner.setSyncIcon('animate'); } - else { - Zotero.Sync.Runner.setSyncIcon(); - } return true; }