From 413f29e22ade36100ffff11fcd8d07b5ed34a3d4 Mon Sep 17 00:00:00 2001 From: Sline Date: Sat, 1 Nov 2025 15:28:56 +0800 Subject: [PATCH] fix: linux theme sync (#5273) --- src/components/layout/use-custom-theme.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/layout/use-custom-theme.ts b/src/components/layout/use-custom-theme.ts index 145bc5bd..7682b0a9 100644 --- a/src/components/layout/use-custom-theme.ts +++ b/src/components/layout/use-custom-theme.ts @@ -53,10 +53,13 @@ export const useCustomTheme = () => { return; } - if ( + const preferBrowserMatchMedia = typeof window !== "undefined" && - typeof window.matchMedia === "function" - ) { + typeof window.matchMedia === "function" && + // Skip Tauri flow when running purely in browser. + !("__TAURI__" in window); + + if (preferBrowserMatchMedia) { return; }