diff --git a/src/dashboard/example/stores/players.ts b/src/dashboard/example/stores/players.ts index 588e24f..a7c35a7 100644 --- a/src/dashboard/example/stores/players.ts +++ b/src/dashboard/example/stores/players.ts @@ -1,6 +1,5 @@ import { defineStore } from 'pinia'; import { computed, ref, watch } from 'vue'; -import type { Ref } from 'vue'; import { playersReplicant } from '../../../browser_shared/replicants'; import type { Schemas } from '../../../types'; @@ -67,7 +66,6 @@ const writeStorage = (value: PlayersMap) => { export const usePlayersStore = defineStore('players', () => { const players = ref({}); const replicant = playersReplicant; - const replicantRef = replicant?.data as unknown as Ref | undefined; const storageSnapshot = readStorage(); if (storageSnapshot) { players.value = storageSnapshot; @@ -76,7 +74,7 @@ export const usePlayersStore = defineStore('players', () => { const isApplyingReplicant = ref(false); watch( - () => replicantRef?.value, + () => replicant?.data, (value) => { if (!value) { return; @@ -93,11 +91,11 @@ export const usePlayersStore = defineStore('players', () => { players, (value) => { writeStorage(value); - if (isApplyingReplicant.value || !replicantRef) { + if (isApplyingReplicant.value || !replicant) { return; } - replicantRef.value = normalizePlayers(value); - replicant?.save(); + replicant.data = normalizePlayers(value); + replicant.save(); }, { deep: true } ); diff --git a/src/dashboard/example/stores/scoreboard.ts b/src/dashboard/example/stores/scoreboard.ts index a230550..0490214 100644 --- a/src/dashboard/example/stores/scoreboard.ts +++ b/src/dashboard/example/stores/scoreboard.ts @@ -1,6 +1,5 @@ import { defineStore } from 'pinia'; import { computed, ref, watch } from 'vue'; -import type { Ref } from 'vue'; import { scoreboardReplicant } from '../../../browser_shared/replicants'; import type { Schemas } from '../../../types'; @@ -61,7 +60,6 @@ const writeStorage = (value: Scoreboard) => { export const useScoreboardStore = defineStore('scoreboard', () => { const scoreboard = ref({ ...defaultScoreboard }); const replicant = scoreboardReplicant; - const replicantRef = replicant?.data as unknown as Ref | undefined; const storageSnapshot = readStorage(); if (storageSnapshot) { scoreboard.value = storageSnapshot; @@ -70,7 +68,7 @@ export const useScoreboardStore = defineStore('scoreboard', () => { const isApplyingReplicant = ref(false); watch( - () => replicantRef?.value, + () => replicant?.data, (value) => { if (!value) { return; @@ -87,11 +85,11 @@ export const useScoreboardStore = defineStore('scoreboard', () => { scoreboard, (value) => { writeStorage(value); - if (isApplyingReplicant.value || !replicantRef) { + if (isApplyingReplicant.value || !replicant) { return; } - replicantRef.value = normalizeScoreboard(value); - replicant?.save(); + replicant.data = normalizeScoreboard(value); + replicant.save(); }, { deep: true, flush: 'sync' } ); diff --git a/src/graphics/scoreboard/main.vue b/src/graphics/scoreboard/main.vue index 52fc4db..97ae888 100644 --- a/src/graphics/scoreboard/main.vue +++ b/src/graphics/scoreboard/main.vue @@ -1,7 +1,6 @@