commit d98f0ab07ab1034fd0e11abc6c69249639bc1ade
parent fa4df719e19593604107e9ce53ff4430870a0a89
Author: Dan Stillman <dstillman@zotero.org>
Date: Fri, 2 Jan 2009 17:36:49 +0000
Fix error when attempting a Restore from Server immediately after Restore to Server
Diffstat:
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/chrome/content/zotero/preferences/preferences.js b/chrome/content/zotero/preferences/preferences.js
@@ -293,7 +293,7 @@ function handleSyncReset(action) {
// TODO: better error handling
// Verify username and password
- Zotero.Sync.Server.login(function () {
+ var callback = function () {
Zotero.Schema.stopRepositoryTimer();
Zotero.Sync.Runner.clearSyncTimeout();
@@ -317,7 +317,15 @@ function handleSyncReset(action) {
.getService(Components.interfaces.nsIAppStartup);
appStartup.quit(Components.interfaces.nsIAppStartup.eRestart);
appStartup.quit(Components.interfaces.nsIAppStartup.eAttemptQuit);
- });
+ };
+
+ // TODO: better way of checking for an active session?
+ if (Zotero.Sync.Server.sessionIDComponent == 'sessionid=') {
+ Zotero.Sync.Server.login(callback);
+ }
+ else {
+ callback();
+ }
break;
// Cancel