commit afbf22240a458b4097b511a55108686b5f3389ca
parent 5b84dfe6d0ca7845ecc650703e403fe6ff4c1acc
Author: Dan Stillman <dstillman@zotero.org>
Date: Tue, 8 Dec 2009 21:08:20 +0000
Don't keep trying to auto-sync if manual sync required
Diffstat:
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/chrome/content/zotero/overlay.xul b/chrome/content/zotero/overlay.xul
@@ -388,7 +388,7 @@
</hbox>
<toolbarbutton id="zotero-tb-sync-warning" hidden="true"/>
<toolbarbutton id="zotero-tb-sync" class="zotero-tb-button" tooltip="_child"
- oncommand="Zotero.Sync.Server.canAutoResetClient = true; Zotero.Sync.Runner.sync()">
+ oncommand="Zotero.Sync.Server.canAutoResetClient = true; Zotero.Sync.Server.manualSyncRequired = false; Zotero.Sync.Runner.sync()">
<tooltip
id="zotero-tb-sync-tooltip"
onpopupshowing="Zotero.Sync.Runner.registerSyncStatusLabel(this.firstChild.nextSibling)"
diff --git a/chrome/content/zotero/xpcom/sync.js b/chrome/content/zotero/xpcom/sync.js
@@ -668,6 +668,12 @@ Zotero.Sync.Runner = new function () {
Zotero.debug('Sync already in progress -- skipping auto-sync', 4);
return;
}
+
+ if (Zotero.Sync.Server.manualSyncRequired) {
+ Zotero.debug('Manual sync required -- skipping auto-sync', 4);
+ return;
+ }
+
Zotero.Sync.Runner.sync(background);
}
}
@@ -1097,6 +1103,8 @@ Zotero.Sync.Server = new function () {
});
+ this.canAutoResetClient = true;
+ this.manualSyncRequired = false;
this.nextLocalSyncDate = false;
this.apiVersion = 6;
@@ -1113,7 +1121,6 @@ Zotero.Sync.Server = new function () {
var _sessionID;
var _throttleTimeout;
var _checkTimer;
- var _canAutoResetClient = true;
var _callbacks = {
onSuccess: function () {
@@ -2690,6 +2697,8 @@ Zotero.Sync.Server.Data = new function() {
//
if (toReconcile.length) {
if (Zotero.Sync.Runner.background) {
+ Zotero.Sync.Server.manualSyncRequired = true;
+
// TODO: localize
throw ("An automatic sync resulted in a conflict that requires manual intervention.\n\nClick the sync icon to sync manually.");
}