Fix replicant reactivity for scoreboard

This commit is contained in:
Pandipipas
2026-02-08 17:19:06 +01:00
parent aa6c9acf1c
commit 62ce10df55
3 changed files with 10 additions and 18 deletions
+2 -6
View File
@@ -1,7 +1,6 @@
<script setup lang="ts">
import { useHead } from '@unhead/vue';
import { computed } from 'vue';
import type { Ref } from 'vue';
import { playersReplicant, scoreboardReplicant } from '../../browser_shared/replicants';
import type { Schemas } from '../../types';
@@ -17,11 +16,8 @@ const defaultScoreboard: Schemas.Scoreboard = {
round: '',
};
const playersData = playersReplicant?.data as unknown as Ref<Schemas.Players | undefined> | undefined;
const scoreboardData = scoreboardReplicant?.data as unknown as Ref<Schemas.Scoreboard | undefined> | undefined;
const players = computed<Schemas.Players>(() => playersData?.value ?? {});
const scoreboard = computed<Schemas.Scoreboard>(() => scoreboardData?.value ?? defaultScoreboard);
const players = computed<Schemas.Players>(() => playersReplicant?.data ?? {});
const scoreboard = computed<Schemas.Scoreboard>(() => scoreboardReplicant?.data ?? defaultScoreboard);
const leftName = computed(() => {
if (scoreboard.value.leftNameOverride) {