Skip to content

Commit

Permalink
clear boundaries between connections
Browse files Browse the repository at this point in the history
  • Loading branch information
Lord-McSweeney authored Nov 22, 2023
1 parent fe580c0 commit f9f7bbc
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions sc-proto/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<title></title>
<script>
const SHOW_DEBUG = false;
let USED_DIRECTORY_ID = ""; // Directory API ID in chrome://policy
let USED_USER_EMAIL = "";
let USED_SECURLY_VERSION = "24.0.1307.0";
Expand Down Expand Up @@ -58,9 +59,6 @@
document.getElementById("info").innerText = `Authentication status: ${authenticationStatus}\nStudent name: ${studentName}\nServer URL: ${config?.serverUrl ? config?.serverUrl : "https://deviceconsole.*******.com"}\nStatus: ${connectionStatus}\nClass session: ${classSession}`;
}


const SHOW_DEBUG = 0;

console.log = function(...args) {
let res = "";
let ans = Array.from(args);
Expand Down Expand Up @@ -717,7 +715,7 @@
message = null,
poll = true;

for (; poll && isConnected;) {
for (; poll; ) {
try {
if (!message) {
message = Router.getAck();
Expand Down Expand Up @@ -768,6 +766,10 @@
}

console.log("[INFO] Continuing long polling");
if (!isConnected) {
console.log("----------------------------------------------- END POLLING (DISCONNECT) -----------------------------------------------");
break;
}
}

console.log("[DEBUG] Long polling stopped");
Expand All @@ -777,6 +779,7 @@

async function main() {
try {
console.log("--------------------------------------------------- NEW CONNECTION ---------------------------------------------------");
connectionStatus = "Initializing...";
updateStatuses();
config = new Config({});
Expand Down Expand Up @@ -844,6 +847,7 @@
// defer
setTimeout(function() {
document.getElementById("disconnect").onclick = function() {
console.log("------------------------------------------------ REQUESTED DISCONNECT ------------------------------------------------");
onDisconnect();
}
}, 50);
Expand Down

0 comments on commit f9f7bbc

Please sign in to comment.