1
0
mirror of https://github.com/misskey-dev/misskey.git synced 2026-05-14 18:05:43 +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

@@ -131,7 +131,7 @@ function applyThemeInternal(theme: Theme, persist: boolean) {
}
let timeout: number | null = null;
let currentTheme: Theme | null = null;
let currentThemeId = miLocalStorage.getItem('themeId');
export function applyTheme(theme: Theme, persist = true) {
if (timeout) {
@@ -139,9 +139,8 @@ export function applyTheme(theme: Theme, persist = true) {
timeout = null;
}
if (deepEqual(currentTheme, theme)) return;
// リアクティビティ解除
currentTheme = deepClone(theme);
if (theme.id === currentThemeId) return;
currentThemeId = theme.id;
if (window.document.startViewTransition != null) {
window.document.documentElement.classList.add('_themeChanging_');