mirror of
https://github.com/azures04/crafatar.git
synced 2026-05-06 11:00:39 +02:00
detect & show mojang issues
This commit is contained in:
@@ -14,15 +14,23 @@ xhr.onload = function() {
|
||||
var error = null;
|
||||
|
||||
if (textures || session && skins) {
|
||||
error = "both";
|
||||
error = "all";
|
||||
} else if (skins) {
|
||||
error = "name";
|
||||
error = "username";
|
||||
} else if (session) {
|
||||
error = "uuid";
|
||||
error = "UUID";
|
||||
}
|
||||
|
||||
console.log(error);
|
||||
if (error) {
|
||||
var warn = document.createElement("div");
|
||||
warn.setAttribute("class", "alert alert-warning");
|
||||
warn.setAttribute("role", "alert");
|
||||
warn.innerHTML = "<h5>Mojang issues</h5> Mojang's servers are having trouble <i>right now</i>, this affects <b>" + error + "</b> requests at Crafatar. <small><a href=\"https://help.mojang.com\" target=\"_blank\">check status</a>";
|
||||
document.querySelector("#alerts").appendChild(warn);
|
||||
}
|
||||
};
|
||||
|
||||
xhr.open("GET", "https://status.mojang.com/check", true);
|
||||
xhr.send();
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
xhr.open("GET", "https://status.mojang.com/check", true);
|
||||
xhr.send();
|
||||
});
|
||||
Reference in New Issue
Block a user