From 76f868d242b2ad2cf32f76b731797a587610e63d Mon Sep 17 00:00:00 2001 From: naiba Date: Tue, 17 Dec 2024 22:19:22 +0800 Subject: [PATCH] fix: typo & render error --- src/routes/root.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/routes/root.tsx b/src/routes/root.tsx index 4c36684..4c91d09 100644 --- a/src/routes/root.tsx +++ b/src/routes/root.tsx @@ -14,7 +14,13 @@ export default function Root() { useEffect(() => { document.title = settingData?.site_name || "哪吒监控 Nezha Monitoring" - }, [settingData]) + }, [settingData?.site_name]) + + useEffect(() => { + if (settingData?.custom_code_dashboard) { + InjectContext(settingData?.custom_code_dashboard) + } + }, [settingData?.custom_code_dashboard]) if (error) { throw error @@ -28,12 +34,6 @@ export default function Root() { i18n.changeLanguage(settingData?.language) } - useEffect(() => { - if (settingData?.custom_code_dashboard) { - InjectContext(settingData?.custom_code) - } - }, [settingData?.custom_code_dashboard]) - return (