parent
105cc4b50a
commit
8fec44d0e9
|
|
@ -178,16 +178,13 @@ export async function common(createVue: () => Promise<App<Element>>) {
|
||||||
window.document.documentElement.dataset.colorScheme = store.s.darkMode ? 'dark' : 'light';
|
window.document.documentElement.dataset.colorScheme = store.s.darkMode ? 'dark' : 'light';
|
||||||
|
|
||||||
if (!isSafeMode) {
|
if (!isSafeMode) {
|
||||||
const darkTheme = prefer.model('darkTheme');
|
watch(prefer.r.darkTheme, (theme) => {
|
||||||
const lightTheme = prefer.model('lightTheme');
|
|
||||||
|
|
||||||
watch(darkTheme, (theme) => {
|
|
||||||
if (store.s.darkMode) {
|
if (store.s.darkMode) {
|
||||||
applyTheme(theme ?? defaultDarkTheme);
|
applyTheme(theme ?? defaultDarkTheme);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
watch(lightTheme, (theme) => {
|
watch(prefer.r.lightTheme, (theme) => {
|
||||||
if (!store.s.darkMode) {
|
if (!store.s.darkMode) {
|
||||||
applyTheme(theme ?? defaultLightTheme);
|
applyTheme(theme ?? defaultLightTheme);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue