From adf962fea59d690c647cbc403895b0dd794d4ead Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Sat, 24 Dec 2022 13:32:55 +0800 Subject: [PATCH] fix.live2d --- components/Live2D.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/components/Live2D.js b/components/Live2D.js index cb53df89..2e2011b6 100644 --- a/components/Live2D.js +++ b/components/Live2D.js @@ -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) + } } }, [])