refactor. 게임 데이터 초기화 개선

- LanguageSwitcher.vue에서 언어 전환 시 게임 데이터 즉시 갱신 로직 개선
- init-game-data.server.ts 파일 추가로 서버 사이드에서 게임 데이터 초기화 로직 구현
- app.vue에서 불필요한 게임 데이터 초기화 로직 제거
This commit is contained in:
clkim
2026-03-25 13:31:41 +09:00
parent 7a3be1754f
commit 4f83ae2311
3 changed files with 22 additions and 13 deletions

View File

@@ -1,13 +1,9 @@
<script setup lang="ts">
import { useNuxtApp } from 'nuxt/app'
const nuxtApp = useNuxtApp()
const { locale } = useI18n()
const gameDataStore = useGameDataStore()
const modalStore = useModalStore()
const scrollStore = useScrollStore()
const { setGameData } = gameDataStore
const { confirm, alert } = modalStore
const {
gameName,
@@ -95,13 +91,6 @@ const setupGameHead = () => {
}
}
if (import.meta.server) {
const gameData = nuxtApp.ssrContext?.event?.context?.gameData
if (gameData) {
setGameData(gameData)
}
}
setupGameHead()
let rafId: number | null = null