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 =