From cd73c3a7cb062e59bfee60f421be8a3a508bf286 Mon Sep 17 00:00:00 2001
From: AprilNEA <github@sku.moe>
Date: Mon, 27 Mar 2023 15:01:35 +0800
Subject: [PATCH] fix: taskbar color follow(#54)

---
 app/components/home.tsx | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/app/components/home.tsx b/app/components/home.tsx
index 1c665f87..fd38ee8c 100644
--- a/app/components/home.tsx
+++ b/app/components/home.tsx
@@ -358,12 +358,20 @@ function useSwitchTheme() {
   const config = useChatStore((state) => state.config);
 
   useEffect(() => {
+    const metaDescription = document.querySelector('meta[name="theme-color"]');
+
     document.body.classList.remove("light");
     document.body.classList.remove("dark");
     if (config.theme === "dark") {
       document.body.classList.add("dark");
+      if (metaDescription){
+        metaDescription.setAttribute('content', "#151515");
+      }
     } else if (config.theme === "light") {
       document.body.classList.add("light");
+      if (metaDescription){
+        metaDescription.setAttribute('content', "#fafafa");
+      }
     }
   }, [config.theme]);
 }