mirror of
https://github.com/Pandipipas/scoreko-dev.git
synced 2026-06-06 03:32:06 +00:00
Fix dashboard replicant saves
This commit is contained in:
@@ -66,7 +66,8 @@ const writeStorage = (value: PlayersMap) => {
|
||||
|
||||
export const usePlayersStore = defineStore('players', () => {
|
||||
const players = ref<PlayersMap>({});
|
||||
const replicantRef = playersReplicant?.data as unknown as Ref<PlayersMap | undefined> | undefined;
|
||||
const replicant = playersReplicant;
|
||||
const replicantRef = replicant?.data as unknown as Ref<PlayersMap | undefined> | 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 }
|
||||
);
|
||||
|
||||
@@ -60,7 +60,8 @@ const writeStorage = (value: Scoreboard) => {
|
||||
|
||||
export const useScoreboardStore = defineStore('scoreboard', () => {
|
||||
const scoreboard = ref<Scoreboard>({ ...defaultScoreboard });
|
||||
const replicantRef = scoreboardReplicant?.data as unknown as Ref<Scoreboard | undefined> | undefined;
|
||||
const replicant = scoreboardReplicant;
|
||||
const replicantRef = replicant?.data as unknown as Ref<Scoreboard | undefined> | 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' }
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user