- remove duplicate variable
- fix error in chatMessage() when processing history - fix turn timer being delayed by one second
This commit is contained in:
parent
c4722060b8
commit
9677ce9886
1 changed files with 5 additions and 4 deletions
|
@ -26,7 +26,6 @@ const buttons = {
|
||||||
}
|
}
|
||||||
var hasTurn = false;
|
var hasTurn = false;
|
||||||
var vm;
|
var vm;
|
||||||
var connected = false;
|
|
||||||
var voteinterval;
|
var voteinterval;
|
||||||
var turninterval;
|
var turninterval;
|
||||||
const chatsound = new Audio(config.chatSound);
|
const chatsound = new Audio(config.chatSound);
|
||||||
|
@ -225,6 +224,7 @@ class CollabVMClient {
|
||||||
clearInterval(turninterval);
|
clearInterval(turninterval);
|
||||||
turnstatus.innerText = `Turn expires in ${secs} seconds.`;
|
turnstatus.innerText = `Turn expires in ${secs} seconds.`;
|
||||||
}
|
}
|
||||||
|
turnUpdate();
|
||||||
turninterval = setInterval(turnUpdate, 1000);
|
turninterval = setInterval(turnUpdate, 1000);
|
||||||
display.className = "focused";
|
display.className = "focused";
|
||||||
}
|
}
|
||||||
|
@ -241,6 +241,7 @@ class CollabVMClient {
|
||||||
turnstatus.innerText = `Waiting for turn in ${secs} seconds.`;
|
turnstatus.innerText = `Waiting for turn in ${secs} seconds.`;
|
||||||
}
|
}
|
||||||
turninterval = setInterval(turnUpdate, 1000);
|
turninterval = setInterval(turnUpdate, 1000);
|
||||||
|
turnUpdate();
|
||||||
display.className = "waiting";
|
display.className = "waiting";
|
||||||
};
|
};
|
||||||
var user = users.find(u => u.username === msgArr[i+3]);
|
var user = users.find(u => u.username === msgArr[i+3]);
|
||||||
|
@ -486,8 +487,8 @@ function chatMessage(user, msg) {
|
||||||
td.innerHTML = msg;
|
td.innerHTML = msg;
|
||||||
else {
|
else {
|
||||||
var u = users.find(u => u.username === user);
|
var u = users.find(u => u.username === user);
|
||||||
var userclass = "";
|
var userclass;
|
||||||
switch (u.rank) {
|
if (u) switch (u.rank) {
|
||||||
case 2:
|
case 2:
|
||||||
userclass = "text-danger";
|
userclass = "text-danger";
|
||||||
break;
|
break;
|
||||||
|
@ -499,6 +500,7 @@ function chatMessage(user, msg) {
|
||||||
userclass = "text-light";
|
userclass = "text-light";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
else userclass = "text-light";
|
||||||
td.innerHTML = `<b class="${userclass}">${user}></b> ${msg}`;
|
td.innerHTML = `<b class="${userclass}">${user}></b> ${msg}`;
|
||||||
}
|
}
|
||||||
tr.appendChild(td);
|
tr.appendChild(td);
|
||||||
|
@ -548,7 +550,6 @@ async function openVM(url, node) {
|
||||||
window.location.href = "#" + node;
|
window.location.href = "#" + node;
|
||||||
vm = new CollabVMClient(url);
|
vm = new CollabVMClient(url);
|
||||||
await vm.connect();
|
await vm.connect();
|
||||||
connected = true;
|
|
||||||
await vm.connectToVM(node);
|
await vm.connectToVM(node);
|
||||||
vmlist.style.display = "none";
|
vmlist.style.display = "none";
|
||||||
vmview.style.display = "block";
|
vmview.style.display = "block";
|
||||||
|
|
Loading…
Reference in a new issue