Commit 46cce590 authored by Benjamin Fischer's avatar Benjamin Fischer

Workspace: prevent feedback loop on double connect with password ask

parent 54723d62
......@@ -90,6 +90,12 @@ define([
this.on("password_required", connectWithPass.bind(this, "password"));
this.on("passphrase_required", connectWithPass.bind(this, "SSH key passphrase"));
this.on("stateChanged", function() {
if (this._passwordDialog) {
this._passwordDialog.abort();
}
});
this.on("connecting", function() {
this._setState("connecting");
});
......@@ -204,10 +210,6 @@ define([
return;
}
if (this._passwordDialog && state != "disconnected") {
this._passwordDialog.close();
}
this.logger.debug(state);
var changed = this._state != state;
......@@ -244,7 +246,7 @@ define([
}
if (this._state == "disconnected" && !this._passwordDialog) {
this._connect(password || $.cookie("tmpPass") || null);
this._connect(password || $.cookie("tmpPass") || null);
$.removeCookie("tmpPass");
}
},
......@@ -290,8 +292,8 @@ define([
var self = this;
if (this._state == "disconnected") {
if (this._passwordDialog) { // abort connecting with pasword
this._passwordDialog.close();
if (this._passwordDialog) { // abort connecting with password
this._passwordDialog.abort();
}
if ($.isFunction(callback)) callback(null);
return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment