Handle server-side session error for /admin/autosave

This commit is contained in:
andrigamerita 2025-06-07 16:38:31 +02:00 committed by GitHub
commit 60858703c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 1 deletions

View file

@ -1132,6 +1132,8 @@ post('/admin/autosave', function () {
}
header('Content-Type: application/json');
echo $response;
} else {
error(401, "Not logged in");
}
});

View file

@ -44,7 +44,14 @@ function updateData() {
}, 6000);
},
error: function(response) {
$("#response-error").html("Error in Autosaving: " + response.statusText);
var httpError = "";
if (response.status !== 0) {
httpError += ": " + response.status;
if (response.responseText) {
httpError += " " + response.responseText;
}
}
$("#response-error").html("Error in Autosaving: " + response.statusText + httpError);
$("#response-error").fadeIn(600, function() {
$("#response-error").css("display", "block");
});