Prevent auto-sync attempt when switching pane/tab mode shortly after pane/tab open if a sync is already running
This commit is contained in:
parent
86504b2424
commit
c51290641d
1 changed files with 16 additions and 10 deletions
|
@ -387,17 +387,23 @@ 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.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;
|
||||
}
|
||||
else {
|
||||
setTimeout(function () {
|
||||
|
||||
Zotero.Sync.Runner.sync(true);
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue