properly dequeue user and reflect that on frontend

This commit is contained in:
Maieul BOYER 2026-01-13 17:17:32 +01:00 committed by Nigel
parent 06fa768c84
commit 52746f8a7f
2 changed files with 8 additions and 4 deletions

View file

@ -311,8 +311,7 @@ function pongClient(
let players = info.players.sort((l, r) => r.score - l.score);
const medals = ["🥇", "🥈", "🥉"];
if (!render_tour_score_once)
{
if (!render_tour_score_once) {
tour_scores.innerHTML = tourScoresHtml;
render_tour_score_once = true;
}
@ -536,7 +535,12 @@ function pongClient(
socket.on("updateInformation", (e) => {
queue_infos.innerText = `${e.totalUser}👤 ${e.inQueue}${e.totalGames}▮•▮`;
});
socket.on("queueEvent", (e) => showInfo(`QueueEvent: ${e}`)); // MAYBE: play a sound? to notify user that smthing happend
socket.on("queueEvent", (e) => {
if (e === "registered") queueBtn.innerText = QueueState.InQueu;
else if (e === "unregistered")
queueBtn.innerText = QueueState.Iddle;
showInfo(`QueueEvent: ${e}`);
}); // MAYBE: play a sound? to notify user that smthing happend
// ---
// queue evt end
// ---

View file

@ -157,7 +157,7 @@ class StateI {
return;
}
this.queue.delete(user.id);
this.dequeueUser(user.socket);
this.tournament.addUser(user.id, name ?? udb.name);
sock.emit('tournamentRegister', {
kind: 'success',