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) => {
|
||||
if (data.init) {
|
||||
if ((window.siyuan.config.appearance.mode === 0 && data.theme === "light") ||
|
||||
(window.siyuan.config.appearance.mode === 1 && data.theme === "dark")) {
|
||||
loadAssets(window.siyuan.config.appearance);
|
||||
} else {
|
||||
if (window.siyuan.config.appearance.modeOS && (
|
||||
(window.siyuan.config.appearance.mode === 1 && data.theme === "light") ||
|
||||
(window.siyuan.config.appearance.mode === 0 && data.theme === "dark")
|
||||
)) {
|
||||
fetchPost("/api/system/setAppearanceMode", {
|
||||
mode: data.theme === "light" ? 0 : 1
|
||||
}, response => {
|
||||
window.siyuan.config.appearance = response.data.appearance;
|
||||
loadAssets(response.data.appearance);
|
||||
});
|
||||
} else {
|
||||
loadAssets(window.siyuan.config.appearance);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue