From 2e0df158c2d6af07ec406059aec53b1f6efebe15 Mon Sep 17 00:00:00 2001 From: RheingoldRiver <18037011+RheingoldRiver@users.noreply.github.com> Date: Wed, 25 Oct 2023 01:48:23 -0500 Subject: [PATCH] fix reading dark mode for realsies --- src/components/AppStateProvider/AppStateProvider.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/AppStateProvider/AppStateProvider.tsx b/src/components/AppStateProvider/AppStateProvider.tsx index 9158626..02caaa3 100644 --- a/src/components/AppStateProvider/AppStateProvider.tsx +++ b/src/components/AppStateProvider/AppStateProvider.tsx @@ -56,7 +56,7 @@ export default function AppStateProvider({ children }: { children: ReactNode }) }); const [darkMode, setDarkMode] = useState(() => { return ( - (window.localStorage.getItem("copy") || "false") === "true" || + (window.localStorage.getItem("theme") || "false") === "true" || !!window.matchMedia("(prefers-color-scheme: dark)").matches ); });