This commit is contained in:
parent
491f1f58dc
commit
fd6153dcbc
1 changed files with 2 additions and 4 deletions
|
@ -40,8 +40,7 @@ export const loadAssets = (data: IAppearance) => {
|
|||
const defaultThemeAddress = `/appearance/themes/${data.mode === 1 ? "midnight" : "daylight"}/theme.css?v=${Constants.SIYUAN_VERSION}`;
|
||||
if (defaultStyleElement) {
|
||||
if (!defaultStyleElement.getAttribute("href").startsWith(defaultThemeAddress)) {
|
||||
defaultStyleElement.remove();
|
||||
addStyle(defaultThemeAddress, "themeDefaultStyle");
|
||||
defaultStyleElement.setAttribute("href", defaultThemeAddress)
|
||||
}
|
||||
} else {
|
||||
addStyle(defaultThemeAddress, "themeDefaultStyle");
|
||||
|
@ -51,8 +50,7 @@ export const loadAssets = (data: IAppearance) => {
|
|||
const themeAddress = `/appearance/themes/${data.mode === 1 ? data.themeDark : data.themeLight}/theme.css?v=${data.themeVer}`;
|
||||
if (styleElement) {
|
||||
if (!styleElement.getAttribute("href").startsWith(themeAddress)) {
|
||||
styleElement.remove();
|
||||
addStyle(themeAddress, "themeStyle");
|
||||
styleElement.setAttribute("href", themeAddress)
|
||||
}
|
||||
} else {
|
||||
addStyle(themeAddress, "themeStyle");
|
||||
|
|
Loading…
Add table
Reference in a new issue