mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-21 09:00:12 +01:00
This commit is contained in:
parent
06b88df2dd
commit
9f96ddc842
1 changed files with 6 additions and 4 deletions
|
|
@ -312,16 +312,18 @@ const initWindow = () => {
|
||||||
});
|
});
|
||||||
ipcRenderer.on(Constants.SIYUAN_UPDATE_THEME, (event, data) => {
|
ipcRenderer.on(Constants.SIYUAN_UPDATE_THEME, (event, data) => {
|
||||||
if (data.init) {
|
if (data.init) {
|
||||||
if ((window.siyuan.config.appearance.mode === 0 && data.theme === "light") ||
|
if (window.siyuan.config.appearance.modeOS && (
|
||||||
(window.siyuan.config.appearance.mode === 1 && data.theme === "dark")) {
|
(window.siyuan.config.appearance.mode === 1 && data.theme === "light") ||
|
||||||
loadAssets(window.siyuan.config.appearance);
|
(window.siyuan.config.appearance.mode === 0 && data.theme === "dark")
|
||||||
} else {
|
)) {
|
||||||
fetchPost("/api/system/setAppearanceMode", {
|
fetchPost("/api/system/setAppearanceMode", {
|
||||||
mode: data.theme === "light" ? 0 : 1
|
mode: data.theme === "light" ? 0 : 1
|
||||||
}, response => {
|
}, response => {
|
||||||
window.siyuan.config.appearance = response.data.appearance;
|
window.siyuan.config.appearance = response.data.appearance;
|
||||||
loadAssets(response.data.appearance);
|
loadAssets(response.data.appearance);
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
loadAssets(window.siyuan.config.appearance);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue