Some tweaks to auto/idle-syncing
- Don't run idle sync if manual sync is required or Zotero is locked - Don't clear sync error icon when opening pane - Better debug message on pane open for syncing not being enabled
This commit is contained in:
parent
daf1899c72
commit
ba8bf4910f
2 changed files with 18 additions and 6 deletions
|
@ -1057,7 +1057,19 @@ Zotero.Sync.Runner.IdleListener = {
|
||||||
return;
|
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.debug("Beginning idle sync");
|
||||||
|
|
||||||
Zotero.Sync.Runner.sync(true);
|
Zotero.Sync.Runner.sync(true);
|
||||||
Zotero.Sync.Runner.setSyncTimeout(this._idleTimeout, true);
|
Zotero.Sync.Runner.setSyncTimeout(this._idleTimeout, true);
|
||||||
},
|
},
|
||||||
|
|
|
@ -411,9 +411,12 @@ var ZoteroPane = new function()
|
||||||
// Auto-sync on pane open
|
// Auto-sync on pane open
|
||||||
if (Zotero.Prefs.get('sync.autoSync')) {
|
if (Zotero.Prefs.get('sync.autoSync')) {
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
if (!Zotero.Sync.Server.enabled
|
if (!Zotero.Sync.Server.enabled) {
|
||||||
|| Zotero.Sync.Server.syncInProgress
|
Zotero.debug('Sync not enabled -- skipping auto-sync', 4);
|
||||||
|| Zotero.Sync.Storage.syncInProgress) {
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Zotero.Sync.Server.syncInProgress || Zotero.Sync.Storage.syncInProgress) {
|
||||||
Zotero.debug('Sync already running -- skipping auto-sync', 4);
|
Zotero.debug('Sync already running -- skipping auto-sync', 4);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -433,9 +436,6 @@ var ZoteroPane = new function()
|
||||||
if (Zotero.Sync.Server.syncInProgress || Zotero.Sync.Storage.syncInProgress) {
|
if (Zotero.Sync.Server.syncInProgress || Zotero.Sync.Storage.syncInProgress) {
|
||||||
Zotero.Sync.Runner.setSyncIcon('animate');
|
Zotero.Sync.Runner.setSyncIcon('animate');
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
Zotero.Sync.Runner.setSyncIcon();
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue