mirror of https://github.com/Jackett/Jackett
UI: fix updateServerConfig error handling
This commit is contained in:
parent
168f04e786
commit
0143bdfe14
|
@ -1111,17 +1111,17 @@ function bindUIButtons() {
|
||||||
omdbkey: jackett_omdb_key
|
omdbkey: jackett_omdb_key
|
||||||
};
|
};
|
||||||
api.updateServerConfig(jsonObject, function (data) {
|
api.updateServerConfig(jsonObject, function (data) {
|
||||||
if (data !== undefined && data.result == "error") {
|
|
||||||
doNotify("Error: " + data.error, "danger", "glyphicon glyphicon-alert");
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
doNotify("Redirecting you to complete configuration update..", "success", "glyphicon glyphicon-ok");
|
doNotify("Redirecting you to complete configuration update..", "success", "glyphicon glyphicon-ok");
|
||||||
window.setTimeout(function () {
|
window.setTimeout(function () {
|
||||||
window.location.reload(true);
|
window.location.reload(true);
|
||||||
}, 3000);
|
}, 3000);
|
||||||
}
|
}).fail(function (data) {
|
||||||
}).fail(function () {
|
if (data.responseJSON !== undefined && data.responseJSON.result == "error") {
|
||||||
|
doNotify("Error: " + data.responseJSON.error, "danger", "glyphicon glyphicon-alert");
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
doNotify("Request to Jackett server failed", "danger", "glyphicon glyphicon-alert");
|
doNotify("Request to Jackett server failed", "danger", "glyphicon glyphicon-alert");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue