Fix error when attempting a Restore from Server immediately after Restore to Server
This commit is contained in:
parent
fa4df719e1
commit
d98f0ab07a
1 changed files with 10 additions and 2 deletions
|
@ -293,7 +293,7 @@ function handleSyncReset(action) {
|
||||||
// TODO: better error handling
|
// TODO: better error handling
|
||||||
|
|
||||||
// Verify username and password
|
// Verify username and password
|
||||||
Zotero.Sync.Server.login(function () {
|
var callback = function () {
|
||||||
Zotero.Schema.stopRepositoryTimer();
|
Zotero.Schema.stopRepositoryTimer();
|
||||||
Zotero.Sync.Runner.clearSyncTimeout();
|
Zotero.Sync.Runner.clearSyncTimeout();
|
||||||
|
|
||||||
|
@ -317,7 +317,15 @@ function handleSyncReset(action) {
|
||||||
.getService(Components.interfaces.nsIAppStartup);
|
.getService(Components.interfaces.nsIAppStartup);
|
||||||
appStartup.quit(Components.interfaces.nsIAppStartup.eRestart);
|
appStartup.quit(Components.interfaces.nsIAppStartup.eRestart);
|
||||||
appStartup.quit(Components.interfaces.nsIAppStartup.eAttemptQuit);
|
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;
|
break;
|
||||||
|
|
||||||
// Cancel
|
// Cancel
|
||||||
|
|
Loading…
Reference in a new issue