From d2b8a93638065a74950eb86fda4f597b88ec4d59 Mon Sep 17 00:00:00 2001 From: Bruno Quaresma Date: Thu, 2 Nov 2023 15:51:39 -0300 Subject: [PATCH] fix(site): fix favicon theme (#10497) --- site/src/pages/WorkspacePage/WorkspaceReadyPage.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/site/src/pages/WorkspacePage/WorkspaceReadyPage.tsx b/site/src/pages/WorkspacePage/WorkspaceReadyPage.tsx index f332ea7850..02b4a0dfb2 100644 --- a/site/src/pages/WorkspacePage/WorkspaceReadyPage.tsx +++ b/site/src/pages/WorkspacePage/WorkspaceReadyPage.tsx @@ -103,9 +103,10 @@ export const WorkspaceReadyPage = ({ if (typeof window === "undefined" || !window.matchMedia) { return; } + const isDark = window.matchMedia("(prefers-color-scheme: dark)"); // We want the favicon the opposite of the theme. - setFaviconTheme(isDark ? "light" : "dark"); + setFaviconTheme(isDark.matches ? "light" : "dark"); }, []); const buildLogs = useWorkspaceBuildLogs(workspace.latest_build.id); const shouldDisplayBuildLogs =