From 95e22a210fdefa18908f6e28848e8f57c77ed8a4 Mon Sep 17 00:00:00 2001 From: lauslim12 <31909304+lauslim12@users.noreply.github.com> Date: Wed, 29 Apr 2026 15:54:26 +0900 Subject: [PATCH] Populate store based on the class to prevent desynchronized themes --- app/use-dark-mode.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/use-dark-mode.ts b/app/use-dark-mode.ts index 8750b82..19a239b 100644 --- a/app/use-dark-mode.ts +++ b/app/use-dark-mode.ts @@ -7,7 +7,7 @@ import { useEffect } from "react"; * as a state for synchronization if it gets called in other components. */ const DarkThemeStore = createStore( - window.matchMedia("(prefers-color-scheme: dark)").matches, + document.documentElement.classList.contains("dark"), ); /**