From f7edcb2dc2d45cb882bc76221e306b1d1a75d00b Mon Sep 17 00:00:00 2001 From: Branden J Brown Date: Sat, 3 Feb 2024 22:55:33 -0600 Subject: [PATCH] watch on game deadline, not game, for timer --- site/src/components/Game.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/site/src/components/Game.vue b/site/src/components/Game.vue index 6db9f6c..bdacbbf 100644 --- a/site/src/components/Game.vue +++ b/site/src/components/Game.vue @@ -86,9 +86,9 @@ const timestamp = useTimestamp({ }, interval: 60, }); -watch(props.game, (now) => { - initTimeLeft.value = now.deadline - timestamp.value; - console.log(initTimeLeft, now.deadline, timestamp.value); +watch(() => props.game.deadline, (now) => { + initTimeLeft.value = now - timestamp.value; + console.log(initTimeLeft, now, timestamp.value); }); const moveColor = computed(() => timeLeft.value > 3000 ? 'primary' : 'red');