mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-13 10:44:20 +01:00
This commit is contained in:
parent
7a68c8ad1b
commit
f06a2e62a5
11 changed files with 175 additions and 71 deletions
|
|
@ -145,7 +145,11 @@ export const initAssets = () => {
|
|||
}, response => {
|
||||
if (window.siyuan.config.appearance.themeJS) {
|
||||
/// #if !MOBILE
|
||||
exportLayout(true);
|
||||
exportLayout({
|
||||
reload: true,
|
||||
onlyData: false,
|
||||
errorExit: false,
|
||||
});
|
||||
/// #else
|
||||
window.location.reload();
|
||||
/// #endif
|
||||
|
|
@ -261,14 +265,22 @@ export const setMode = (modeElementValue: number) => {
|
|||
window.siyuan.config.appearance.themeLight !== response.data.themeLight ||
|
||||
window.siyuan.config.appearance.themeDark !== response.data.themeDark
|
||||
)) {
|
||||
exportLayout(true);
|
||||
exportLayout({
|
||||
reload: true,
|
||||
onlyData: false,
|
||||
errorExit: false,
|
||||
});
|
||||
return;
|
||||
}
|
||||
const OSTheme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
||||
if (response.data.modeOS && (
|
||||
(response.data.mode === 1 && OSTheme === "light") || (response.data.mode === 0 && OSTheme === "dark")
|
||||
)) {
|
||||
exportLayout(true);
|
||||
exportLayout({
|
||||
reload: true,
|
||||
onlyData: false,
|
||||
errorExit: false,
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,11 +23,12 @@ export const processMessage = (response: IWebSocketData) => {
|
|||
/// #if MOBILE
|
||||
window.location.reload();
|
||||
/// #else
|
||||
if (response.data?.dropCurrentLayout) {
|
||||
window.location.reload();
|
||||
} else {
|
||||
exportLayout(true);
|
||||
}
|
||||
exportLayout({
|
||||
reload: true,
|
||||
onlyData: false,
|
||||
errorExit: false,
|
||||
dropEditScroll: response.data?.resetScroll,
|
||||
});
|
||||
/// #endif
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue