fix. 코드 경고 수정

This commit is contained in:
clkim
2025-12-29 15:42:46 +09:00
parent 98280c0139
commit 61e1438ac1
5 changed files with 24 additions and 73 deletions

View File

@@ -7,11 +7,11 @@ import type {
} from '#layers/types/api/gameData'
const nuxtApp = useNuxtApp()
const { locale } = useI18n()
const gameDataStore = useGameDataStore()
const modalStore = useModalStore()
const scrollStore = useScrollStore()
const { locale } = useI18n()
const { setGameData } = gameDataStore
const { gameData } = storeToRefs(gameDataStore)
@@ -111,24 +111,11 @@ if (serverGameData) {
setupMetaData(serverGameData)
}
// Google Analytics 설정 (클라이언트에서만 실행)
if (import.meta.client) {
const { gtag, initialize } = useGtag()
initialize(gameData.value?.ga_code)
gtag('event', 'screen_view', {
app_name: 'My App',
screen_name: 'Home',
})
}
let rafId: number | null = null
let stopWatch: (() => void) | null = null
onMounted(() => {
if (!import.meta.client) return
useEventListener('scroll', scrollStore.updateScrollValue, { passive: true })
stopWatch = watch(
scrollGnbPosition,
newValue => {
@@ -145,6 +132,13 @@ onMounted(() => {
},
{ immediate: true }
)
const { gtag, initialize } = useGtag()
initialize(gameData.value?.ga_code)
gtag('event', 'screen_view', {
app_name: 'My App',
screen_name: 'Home',
})
})
onBeforeUnmount(() => {