Skip to content

Commit

Permalink
fix(app): 336 Fix stats-gl problem
Browse files Browse the repository at this point in the history
  • Loading branch information
JaimeTorrealba committed Jan 28, 2024
1 parent f10476e commit 505e243
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/core/misc/StatsGl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ export const StatsGl = defineComponent<StatsGlProps>({
expose({ statsGl })

const node = document.body
node?.appendChild(statsGl.dom)
const statContainer = statsGl.dom || statsGl.container

node?.appendChild(statContainer)

const { renderer } = useTresContext()
const { onAfterLoop, resume } = useRenderLoop()
Expand All @@ -106,7 +108,8 @@ export const StatsGl = defineComponent<StatsGlProps>({
})

onUnmounted(() => {
node?.removeChild(statsGl.dom)
node?.removeChild(statContainer)
})
},

})

0 comments on commit 505e243

Please sign in to comment.