bug fixed
This commit is contained in:
parent
b725a559f7
commit
439d21e3e6
|
|
@ -336,14 +336,14 @@ export const createLightTheme = (themeVariables: ThemeVariables) => {
|
|||
if (themeLightId) {
|
||||
document.getElementById(themeLightId)?.remove();
|
||||
}
|
||||
return createTheme(themeMap.light, themeVariables);
|
||||
themeLightId = createTheme(themeMap.light, themeVariables);
|
||||
};
|
||||
|
||||
export const createDarkTheme = (themeVariables: ThemeVariables) => {
|
||||
if (themeDarkId) {
|
||||
document.getElementById(themeDarkId)?.remove();
|
||||
}
|
||||
return createTheme(themeMap.dark, themeVariables);
|
||||
themeDarkId = createTheme(themeMap.dark, themeVariables);
|
||||
};
|
||||
|
||||
export const getColorAsync = async () => {
|
||||
|
|
@ -361,8 +361,8 @@ let themeLightId: string | null = null;
|
|||
let themeDarkId: string | null = null;
|
||||
|
||||
getColorAsync().then((color) => {
|
||||
themeLightId = createLightTheme(color.onLight);
|
||||
themeDarkId = createDarkTheme(color.onDark!);
|
||||
createLightTheme(color.onLight);
|
||||
createDarkTheme(color.onDark!);
|
||||
});
|
||||
|
||||
// 在退出的时候删除这两个主题,防止重复加载
|
||||
|
|
|
|||
Loading…
Reference in New Issue