mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-09 08:44:20 +01:00
This commit is contained in:
parent
cc1271c153
commit
d215c2e0e2
1 changed files with 9 additions and 1 deletions
|
|
@ -365,8 +365,16 @@ export const setCodeTheme = (cdn = Constants.PROTYLE_CDN) => {
|
|||
|
||||
export const setMode = (modeElementValue: number) => {
|
||||
/// #if !MOBILE
|
||||
let mode = modeElementValue;
|
||||
if (modeElementValue === 2) {
|
||||
if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
|
||||
mode = 1;
|
||||
} else {
|
||||
mode = 0;
|
||||
}
|
||||
}
|
||||
fetchPost("/api/setting/setAppearance", Object.assign({}, window.siyuan.config.appearance, {
|
||||
mode: modeElementValue === 2 ? window.siyuan.config.appearance.mode : modeElementValue,
|
||||
mode,
|
||||
modeOS: modeElementValue === 2,
|
||||
}), async response => {
|
||||
if (window.siyuan.config.appearance.themeJS) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue