From fc34acda823a0a9fe6c04093f1a456ee394b1935 Mon Sep 17 00:00:00 2001
From: metamethods
Date: Fri, 3 Jan 2025 01:35:55 -0800
Subject: [PATCH] fix: reactivity bug
---
src/lib/Room.svelte | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/lib/Room.svelte b/src/lib/Room.svelte
index 9f0ac1e..ff20447 100644
--- a/src/lib/Room.svelte
+++ b/src/lib/Room.svelte
@@ -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(`/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 @@
- {#each players as player}
+ {#each room.players as player}
{/each}