watch on game deadline, not game, for timer
This commit is contained in:
parent
a318c5457f
commit
f7edcb2dc2
@ -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');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user