From bf897c1e14535d919ee207870461ae8bf77a33fc Mon Sep 17 00:00:00 2001 From: mingjun97 Date: Wed, 4 May 2022 20:45:54 -0700 Subject: [PATCH] Add network status issue --- scripts/onload.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/onload.js b/scripts/onload.js index 9ecdc2c..750a682 100644 --- a/scripts/onload.js +++ b/scripts/onload.js @@ -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; + } }) }