Bläddra i källkod

fix: taskbar color follow(#54)

AprilNEA 1 år sedan
förälder
incheckning
cd73c3a7cb
1 ändrade filer med 8 tillägg och 0 borttagningar
  1. 8 0
      app/components/home.tsx

+ 8 - 0
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]);
 }