authorgravatar for 118054752+extoci@users.noreply.github.comExotic <118054752+extoci@users.noreply.github.com> 2026-08-12 23:43:40+03:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-08-12 16:43:40-04:00
log9666b875164581b67e5d75cf26aa05753e83e49e
tree22391bee8ea26c1e8c61cf183e83849970e321c1
parente3a9c2518d5f71ca24872cb3238c1b921c5ae5a1
signature Signed by PGP key B5690EEEBB952194

fix(web): preserve appearance mode when changing themes (#6343)


1 files changed, 4 insertions(+), 0 deletions(-)

apps/web/src/hooks/useTheme.ts+4
......@@ -473,6 +473,10 @@ export function useTheme() {
473473 const setTheme = useCallback((next: Theme): boolean => {
474474 if (typeof window === "undefined") return false;
475475 try {
476 // Preserve the current mode before replacing a legacy or inferred theme
477 // preference. Otherwise a fresh System preference is re-inferred from
478 // the new theme's base appearance, which can switch a dark UI to light.
479 writeAppearanceModePreference(readAppearanceModePreference(getStored()));
476480 // Choosing a whole theme replaces any automatic-mode mix. The mix is
477481 // captured first so a failed preference write can put it back instead
478482 // of erasing it or leaving it attached to the new theme.