fix: reactivity bug
This commit is contained in:
parent
6a49c361a0
commit
fc34acda82
@ -12,7 +12,6 @@
|
||||
let { room }: { room: Room } = $props();
|
||||
|
||||
let roomTimer = $state(room.secondsRemaining);
|
||||
let players = $state(room.players);
|
||||
|
||||
onMount(() => {
|
||||
if (!room.finished) {
|
||||
@ -30,7 +29,7 @@
|
||||
.get<Room>(`/api/room/${room.roomId}`)
|
||||
.then((result) => result.data);
|
||||
roomTimer = updatedRoom.secondsRemaining;
|
||||
players = updatedRoom.players;
|
||||
room.players = updatedRoom.players;
|
||||
if (updatedRoom.finished) {
|
||||
console.log('killing invervals');
|
||||
clearInterval(roomTimerUpdateInterval);
|
||||
@ -72,7 +71,7 @@
|
||||
</p>
|
||||
|
||||
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2 sm:grid-rows-2">
|
||||
{#each players as player}
|
||||
{#each room.players as player}
|
||||
<Player {player} />
|
||||
{/each}
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user