fix.live2d

This commit is contained in:
tangly1024
2022-12-24 13:32:55 +08:00
parent 82a190fd85
commit adf962fea5

View File

@@ -8,9 +8,11 @@ export default function Live2D() {
const { switchTheme } = useGlobal()
React.useEffect(() => {
window.addEventListener('scroll', initLive2D)
return () => {
window.removeEventListener('scroll', initLive2D)
if (BLOG.WIDGET_PET) {
window.addEventListener('scroll', initLive2D)
return () => {
window.removeEventListener('scroll', initLive2D)
}
}
}, [])