diff --git a/src/components/Ingame.vue b/src/components/Ingame.vue index 9d85ee3..72fbdcc 100644 --- a/src/components/Ingame.vue +++ b/src/components/Ingame.vue @@ -9,10 +9,22 @@ import ScoreboardC from "@/components/ingame/ScoreboardC.vue"; import TurnC from "@/components/ingame/TurnC.vue"; import TrumpC from "@/components/ingame/TrumpC.vue"; import {storeToRefs} from "pinia"; -import {toRefs} from "vue"; +import {ref, toRefs, watch} from "vue"; const ig = useIngame() const { state } = toRefs(ig) + +const cachedGameInfo = ref(null) + +watch( + () => ig.data, + (newData) => { + if (state.value === 'InGame' && newData) { + cachedGameInfo.value = newData as GameInfo + } + }, + { deep: true, immediate: true } +)