From aa6c9acf1c9f37660819773bea40915ae91de032 Mon Sep 17 00:00:00 2001 From: Pandipipas <62224708+Pandipipas@users.noreply.github.com> Date: Sun, 8 Feb 2026 17:10:27 +0100 Subject: [PATCH] Fix dashboard replicant saves --- src/dashboard/example/stores/players.ts | 4 +++- src/dashboard/example/stores/scoreboard.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/dashboard/example/stores/players.ts b/src/dashboard/example/stores/players.ts index bfa1bf5..588e24f 100644 --- a/src/dashboard/example/stores/players.ts +++ b/src/dashboard/example/stores/players.ts @@ -66,7 +66,8 @@ const writeStorage = (value: PlayersMap) => { export const usePlayersStore = defineStore('players', () => { const players = ref({}); - const replicantRef = playersReplicant?.data as unknown as Ref | undefined; + const replicant = playersReplicant; + const replicantRef = replicant?.data as unknown as Ref | undefined; const storageSnapshot = readStorage(); if (storageSnapshot) { players.value = storageSnapshot; @@ -96,6 +97,7 @@ export const usePlayersStore = defineStore('players', () => { return; } replicantRef.value = normalizePlayers(value); + replicant?.save(); }, { deep: true } ); diff --git a/src/dashboard/example/stores/scoreboard.ts b/src/dashboard/example/stores/scoreboard.ts index 5315743..a230550 100644 --- a/src/dashboard/example/stores/scoreboard.ts +++ b/src/dashboard/example/stores/scoreboard.ts @@ -60,7 +60,8 @@ const writeStorage = (value: Scoreboard) => { export const useScoreboardStore = defineStore('scoreboard', () => { const scoreboard = ref({ ...defaultScoreboard }); - const replicantRef = scoreboardReplicant?.data as unknown as Ref | undefined; + const replicant = scoreboardReplicant; + const replicantRef = replicant?.data as unknown as Ref | undefined; const storageSnapshot = readStorage(); if (storageSnapshot) { scoreboard.value = storageSnapshot; @@ -90,6 +91,7 @@ export const useScoreboardStore = defineStore('scoreboard', () => { return; } replicantRef.value = normalizeScoreboard(value); + replicant?.save(); }, { deep: true, flush: 'sync' } );