1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-02 14:26:28 +02:00

fix(frontend): ダークモードの同期が機能しない場合がある問題を修正

Fix #16688
This commit is contained in:
syuilo
2025-10-22 09:11:15 +09:00
parent 7a82c1a912
commit aafd8b6bf7
3 changed files with 5 additions and 13 deletions

View File

@@ -176,7 +176,7 @@ export async function common(createVue: () => Promise<App<Element>>) {
})();
applyTheme(theme);
}, { immediate: isSafeMode || miLocalStorage.getItem('theme') == null });
}, { immediate: true });
window.document.documentElement.dataset.colorScheme = store.s.darkMode ? 'dark' : 'light';
@@ -195,14 +195,6 @@ export async function common(createVue: () => Promise<App<Element>>) {
applyTheme(theme ?? defaultLightTheme);
}
});
}
if (!isSafeMode) {
if (prefer.s.darkTheme && store.s.darkMode) {
if (miLocalStorage.getItem('themeId') !== prefer.s.darkTheme.id) applyTheme(prefer.s.darkTheme);
} else if (prefer.s.lightTheme && !store.s.darkMode) {
if (miLocalStorage.getItem('themeId') !== prefer.s.lightTheme.id) applyTheme(prefer.s.lightTheme);
}
fetchInstanceMetaPromise.then(() => {
// TODO: instance.defaultLightTheme/instance.defaultDarkThemeが不正な形式だった場合のケア