mirror of
https://github.com/SpikeHD/MojoFrontend.git
synced 2024-11-22 01:05:33 +00:00
Add network status issue
This commit is contained in:
parent
963ad3e7f5
commit
bf897c1e14
@ -1,3 +1,5 @@
|
||||
var networkIssuesInformed = false;
|
||||
|
||||
function checkStatus(){
|
||||
var status = document.getElementById("status");
|
||||
sendCommand("", "ping").then(res => {
|
||||
@ -5,6 +7,7 @@ function checkStatus(){
|
||||
status.classList.add("ready");
|
||||
status.classList.remove("error");
|
||||
document.getElementById("statusText").innerText = "Ready";
|
||||
networkIssuesInformed = false;
|
||||
} else {
|
||||
throw new Error("");
|
||||
}
|
||||
@ -12,6 +15,10 @@ function checkStatus(){
|
||||
status.classList.add("error");
|
||||
status.classList.remove("ready");
|
||||
document.getElementById("statusText").innerText = "Error";
|
||||
if (!networkIssuesInformed) {
|
||||
message("Network issue detected, you may request a new MojoConsole link in game.", "fail");
|
||||
networkIssuesInformed = true;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user