mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 09:30:14 +01:00
This commit is contained in:
parent
301978b164
commit
4573171fdd
1 changed files with 8 additions and 8 deletions
|
|
@ -769,6 +769,7 @@ export const bazaar = {
|
||||||
(window.siyuan.config.appearance.mode === 0 && window.siyuan.config.appearance.themeLight === dataObj.name) ||
|
(window.siyuan.config.appearance.mode === 0 && window.siyuan.config.appearance.themeLight === dataObj.name) ||
|
||||||
(window.siyuan.config.appearance.mode === 1 && window.siyuan.config.appearance.themeDark === dataObj.name)
|
(window.siyuan.config.appearance.mode === 1 && window.siyuan.config.appearance.themeDark === dataObj.name)
|
||||||
)) {
|
)) {
|
||||||
|
const currentTheme = window.siyuan.config.appearance.mode === 1 ? window.siyuan.config.appearance.themeDark : window.siyuan.config.appearance.themeLight;
|
||||||
if (window.siyuan.config.appearance.themeJS) {
|
if (window.siyuan.config.appearance.themeJS) {
|
||||||
if (window.destroyTheme) {
|
if (window.destroyTheme) {
|
||||||
try {
|
try {
|
||||||
|
|
@ -777,9 +778,8 @@ export const bazaar = {
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("destroyTheme error: " + e);
|
console.error("destroyTheme error: " + e);
|
||||||
}
|
}
|
||||||
const themeScriptElement = document.getElementById("themeScript") as HTMLScriptElement;
|
document.getElementById("themeScript").remove();
|
||||||
themeScriptElement.remove();
|
addScript(`/appearance/themes/${currentTheme}/theme.js?v=${response.data.appearance.themeVer}`, "themeScript");
|
||||||
addScript(themeScriptElement.src + "1", "themeScript");
|
|
||||||
} else {
|
} else {
|
||||||
exportLayout({
|
exportLayout({
|
||||||
cb() {
|
cb() {
|
||||||
|
|
@ -790,11 +790,11 @@ export const bazaar = {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const defaultThemeElement = (document.getElementById("themeDefaultStyle") as HTMLLinkElement);
|
if ((window.siyuan.config.appearance.mode === 1 && currentTheme === "midnight") ||
|
||||||
defaultThemeElement.href = defaultThemeElement.href + "1";
|
(window.siyuan.config.appearance.mode !== 1 && currentTheme === "daylight")) {
|
||||||
const themeElement = (document.getElementById("themeStyle") as HTMLLinkElement);
|
(document.getElementById("themeDefaultStyle") as HTMLLinkElement).href = `/appearance/themes/${window.siyuan.config.appearance.mode === 1 ? "midnight" : "daylight"}/theme.css?v=${Constants.SIYUAN_VERSION}`;
|
||||||
if (themeElement) {
|
} else {
|
||||||
themeElement.href = themeElement.href + "1";
|
(document.getElementById("themeStyle") as HTMLLinkElement).href = `/appearance/themes/${currentTheme}/theme.css?v=${response.data.appearance.themeVer}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue