From aafd8b6bf77a3e8fc1ae6dc202aa83caa46ed4fa Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Wed, 22 Oct 2025 09:11:15 +0900 Subject: fix(frontend): ダークモードの同期が機能しない場合がある問題を修正 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix #16688 --- packages/frontend/src/theme.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'packages/frontend/src/theme.ts') diff --git a/packages/frontend/src/theme.ts b/packages/frontend/src/theme.ts index 4d03b1d0e9..7cbaf87243 100644 --- a/packages/frontend/src/theme.ts +++ b/packages/frontend/src/theme.ts @@ -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_'); -- cgit v1.2.3-freya