1 parent
664a8fff79
commit
0904f9917d
1 file changed
+4
@@ -16,6 +16,8 @@ $(function () {
|
||||
var buttonElement = $("#login-button");
|
||||
var reconnectElement = $("#login-reconnect");
|
||||
|
||||
var ignoreDisconnect = false;
|
||||
|
||||
buttonElement.click(function () {
|
||||
var usernameElement = $("#login-user");
|
||||
var passwordElement = $("#login-password");
|
||||
@@ -31,6 +33,7 @@ $(function () {
|
||||
OctoPrint.browser
|
||||
.login(username, password, remember)
|
||||
.done(function () {
|
||||
ignoreDisconnect = true;
|
||||
window.location.href = REDIRECT_URL;
|
||||
})
|
||||
.fail(function () {
|
||||
@@ -52,6 +55,7 @@ $(function () {
|
||||
};
|
||||
|
||||
OctoPrint.socket.onDisconnected = function () {
|
||||
if (ignoreDisconnect) return;
|
||||
buttonElement.prop("disabled", true);
|
||||
offlineElement.addClass("in");
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user