diff --git a/app/components/home.tsx b/app/components/home.tsx index 4c3d0a646..6b34a5a1b 100644 --- a/app/components/home.tsx +++ b/app/components/home.tsx @@ -64,17 +64,17 @@ export function useSwitchTheme() { } const metaDescriptionDark = document.querySelector( - 'meta[name="theme-color"][media]', + 'meta[name="theme-color"][media*="dark"]', ); const metaDescriptionLight = document.querySelector( - 'meta[name="theme-color"]:not([media])', + 'meta[name="theme-color"][media*="light"]', ); if (config.theme === "auto") { metaDescriptionDark?.setAttribute("content", "#151515"); metaDescriptionLight?.setAttribute("content", "#fafafa"); } else { - const themeColor = getCSSVar("--themeColor"); + const themeColor = getCSSVar("--theme-color"); metaDescriptionDark?.setAttribute("content", themeColor); metaDescriptionLight?.setAttribute("content", themeColor); } diff --git a/app/layout.tsx b/app/layout.tsx index f2e765ae0..d08f87e44 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -9,11 +9,19 @@ const buildConfig = getBuildConfig(); export const metadata = { title: "ChatGPT Next Web", description: "Your personal ChatGPT Chat Bot.", + viewport: { + width: "device-width", + initialScale: 1, + maximumScale: 1, + }, + themeColor: [ + { media: "(prefers-color-scheme: light)", color: "#fafafa" }, + { media: "(prefers-color-scheme: dark)", color: "#151515" }, + ], appleWebApp: { title: "ChatGPT Next Web", statusBarStyle: "default", }, - viewport: "width=device-width, initial-scale=1, maximum-scale=1", }; export default function RootLayout({ @@ -24,22 +32,12 @@ export default function RootLayout({ return ( - -