watch on game deadline, not game, for timer

This commit is contained in:
Branden J Brown 2024-02-03 22:55:33 -06:00
parent a318c5457f
commit f7edcb2dc2
1 changed files with 3 additions and 3 deletions

View File

@ -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');