diff --git a/src/routes/admin/+page.svelte b/src/routes/admin/+page.svelte index 2cb6b0a..e343cb5 100644 --- a/src/routes/admin/+page.svelte +++ b/src/routes/admin/+page.svelte @@ -1,16 +1,25 @@
@@ -50,11 +66,13 @@
-
- Queued Scouts -
+
+

Queued Scouts

+
{#each scout_queue as scout} -

{scout}

+ {/each}
diff --git a/src/routes/queue/+page.svelte b/src/routes/queue/+page.svelte index 70bf9ec..965f6f7 100644 --- a/src/routes/queue/+page.svelte +++ b/src/routes/queue/+page.svelte @@ -1,19 +1,25 @@ diff --git a/tailwind.config.js b/tailwind.config.cjs similarity index 100% rename from tailwind.config.js rename to tailwind.config.cjs diff --git a/ws.ts b/ws.ts index e583ba4..dd9c404 100644 --- a/ws.ts +++ b/ws.ts @@ -26,10 +26,16 @@ const webSocketServer = { socket.emit('time_to_scout', [curr_match_key, ...team_data]); }); - socket.on('leave_queue', () => { - const scout_id = sid_to_scout.get(socket.id); - - io.in('admin_room').emit('scout_left_queue', scout_id); + socket.on('leave_queue', (scout_id: string) => { + const scout_sid = sid_to_scout + .entries() + .filter(([_sid, scout]) => scout === scout_id) + .map(([sid, _]) => sid) + .toArray()[0]; + // This event exist in the cast that the scout removed itself from the queue + io.to('admin_room').emit('scout_left_queue', scout_id); + // This event exists in the case that the admin removed the scout from the queue + io.to(scout_sid).emit('you_left_queue'); socket.leave('scout_queue'); });