remove alert interface and use new error interface

This commit is contained in:
alu
2026-07-28 20:41:01 +00:00
parent 5786b7e1be
commit 1f672e16e6
7 changed files with 43 additions and 80 deletions
+4 -6
View File
@@ -1,5 +1,5 @@
import { goToPage, setAppearance, requestAPI } from "./utils.js";
import { alert } from "./dialog.js";
import { error } from "./dialog.js";
window.addEventListener("DOMContentLoaded", init);
@@ -19,18 +19,16 @@ async function init () {
goToPage("index");
}
else if (ticket.status === 401) {
alert("Authenticaton failed.");
error("Authenticaton failed.");
formSubmitButton.innerText = "LOGIN";
}
else if (ticket.status === 408) {
alert("Network error.");
error("Network error.");
formSubmitButton.innerText = "LOGIN";
}
else {
alert("An error occured.");
console.error(ticket);
error(`An error occured: ${JSON.stringify(ticket)}`);
formSubmitButton.innerText = "LOGIN";
console.error(ticket.error);
}
});
}