From b774d36bcd80fc7af6c7221a6c619c0502337104 Mon Sep 17 00:00:00 2001 From: tangly1024 Date: Tue, 26 Apr 2022 12:39:44 +0800 Subject: [PATCH] =?UTF-8?q?live2d=20=E9=85=8D=E7=BD=AE=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Live2D.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/Live2D.js b/components/Live2D.js index 43578793..89e68301 100644 --- a/components/Live2D.js +++ b/components/Live2D.js @@ -5,7 +5,7 @@ import { loadExternalResource } from '@/lib/utils' import { useEffect } from 'react' export default function Live2D() { - if (!BLOG.WIDGET_PET) { + if (!BLOG.WIDGET_PET || !JSON.parse(BLOG.WIDGET_PET)) { return <> } const { switchTheme } = useGlobal() @@ -29,7 +29,7 @@ function initLive2D() { Promise.all([ // loadExternalResource('https://cdn.zhangxinxu.com/sp/demo/live2d/live2d/js/live2d.js', 'js') loadExternalResource('https://cdn.jsdelivr.net/gh/stevenjoezhang/live2d-widget@latest/live2d.min.js', 'js') - ]).then(() => { + ]).then((e) => { // https://github.com/xiazeyu/live2d-widget-models loadlive2d('live2d', BLOG.WIDGET_PET_LINK) })