Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: fix https://github.com/siyuan-note/siyuan/issues/6817

Vanessab38c20b84c63
diff --git a/app/src/util/assets.ts b/app/src/util/assets.ts
index f571f28b19..02c3720275 100644
--- a/app/src/util/assets.ts
+++ b/app/src/util/assets.ts
@@ -6,7 +6,7 @@ import {ipcRenderer} from "electron";
import {getAllModels} from "../layout/getAll";
import {exportLayout} from "../layout/util";
/// #endif
-import {isMobile} from "./functions";
+import {isBrowser, isMobile} from "./functions";
import {fetchPost} from "./fetch";
const loadThirdIcon = (iconURL: string, data: IAppearance) => {
@@ -231,7 +231,8 @@ export const setMode = (modeElementValue: number) => {
window.siyuan.config.appearance.themeDark !== response.data.themeDark
)
) ||
- (response.data.modeOS && !window.siyuan.config.appearance.modeOS)
+ // Electron 中 ipcRenderer 会触发 nativeTheme.themeSource 从而触发 window.matchMedia 中的 watchTheme
+ (response.data.modeOS && !window.siyuan.config.appearance.modeOS && isBrowser())
) {
exportLayout(true);
return;