mirror of
https://github.com/SpikeHD/MojoFrontend.git
synced 2024-11-22 09:08: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(){
|
function checkStatus(){
|
||||||
var status = document.getElementById("status");
|
var status = document.getElementById("status");
|
||||||
sendCommand("", "ping").then(res => {
|
sendCommand("", "ping").then(res => {
|
||||||
@ -5,6 +7,7 @@ function checkStatus(){
|
|||||||
status.classList.add("ready");
|
status.classList.add("ready");
|
||||||
status.classList.remove("error");
|
status.classList.remove("error");
|
||||||
document.getElementById("statusText").innerText = "Ready";
|
document.getElementById("statusText").innerText = "Ready";
|
||||||
|
networkIssuesInformed = false;
|
||||||
} else {
|
} else {
|
||||||
throw new Error("");
|
throw new Error("");
|
||||||
}
|
}
|
||||||
@ -12,6 +15,10 @@ function checkStatus(){
|
|||||||
status.classList.add("error");
|
status.classList.add("error");
|
||||||
status.classList.remove("ready");
|
status.classList.remove("ready");
|
||||||
document.getElementById("statusText").innerText = "Error";
|
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