diff --git a/src/lib/Room.svelte b/src/lib/Room.svelte index 1de15bf..9f0ac1e 100644 --- a/src/lib/Room.svelte +++ b/src/lib/Room.svelte @@ -12,6 +12,7 @@ let { room }: { room: Room } = $props(); let roomTimer = $state(room.secondsRemaining); + let players = $state(room.players); onMount(() => { if (!room.finished) { @@ -29,7 +30,9 @@ .get(`/api/room/${room.roomId}`) .then((result) => result.data); roomTimer = updatedRoom.secondsRemaining; + players = updatedRoom.players; if (updatedRoom.finished) { + console.log('killing invervals'); clearInterval(roomTimerUpdateInterval); clearInterval(roomTimerSyncInterval); } @@ -69,7 +72,7 @@

- {#each room.players as player} + {#each players as player} {/each}