This commit is contained in:
Miki 2023-12-06 11:00:38 +01:00
parent 555e7b85ea
commit 34ecc9f036
17 changed files with 70 additions and 57 deletions

View file

@ -28,22 +28,6 @@
let end = false;
let start = false;
// function updateRemainingTime() {
// if ((min === 0) & (sec === 0)) {
// clearInterval(timer);
// end = true;
// } else if (sec === 0) {
// min -= 1;
// sec = 59;
// } else {
// sec -= 1;
// }
// }
// updateRemainingTime();
// const timer = setInterval(updateRemainingTime, 1000);
function Subscribe() {
const sse = new EventSource(`/api/sse`);
console.log('subscribe');
@ -76,19 +60,6 @@
console.log('pressed P');
} else {
console.log(`pressed: [${id}] ${surfers[id].priority}`);
// let oldps = parseInt(surfers[id].priority);
// for (let i in surfers) {
// if (i != id) {
// console.log(`pos: [${i}] ${surfers[i].priority} ${surfers[i].priority < oldpos}`);
// if (surfers[i].priority != 'P' && surfers[i].priority < oldpos) {
// let pos = parseInt(surfers[i].priority);
// if ()
// }
// } else {
// surfers[i] = 'P';
// console.log(`first: [${i}] ${surfers[i].priority}`);
// }
// }
}
}

View file