From 9f768b8022bf683c1e421962de0172fd15de682b Mon Sep 17 00:00:00 2001 From: syuilo <4439005+syuilo@users.noreply.github.com> Date: Sat, 25 Oct 2025 08:22:47 +0900 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20=E3=82=AD=E3=83=A3=E3=83=83?= =?UTF-8?q?=E3=82=B7=E3=83=A5=E3=82=92=E3=82=AF=E3=83=AA=E3=82=A2=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=81=A8=E3=83=86=E3=83=BC=E3=83=9E=E5=86=8D=E9=81=A9?= =?UTF-8?q?=E7=94=A8=E3=81=99=E3=82=8B=E3=81=BE=E3=81=A7=E3=83=AC=E3=83=B3?= =?UTF-8?q?=E3=83=80=E3=83=AA=E3=83=B3=E3=82=B0=E3=81=8C=E6=AD=A3=E3=81=97?= =?UTF-8?q?=E3=81=8F=E8=A1=8C=E3=82=8F=E3=82=8C=E3=81=AA=E3=81=84=E5=95=8F?= =?UTF-8?q?=E9=A1=8C=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 +- packages/frontend/src/theme.ts | 6 ++++++ packages/frontend/src/utility/clear-cache.ts | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 407666b5ae..1e1321b66e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ - ### Client -- +- Fix: キャッシュをクリアするとテーマ再適用するまでレンダリングが正しく行われない問題を修正 ### Server - diff --git a/packages/frontend/src/theme.ts b/packages/frontend/src/theme.ts index 13f5dbf60e..4da8c02d33 100644 --- a/packages/frontend/src/theme.ts +++ b/packages/frontend/src/theme.ts @@ -242,3 +242,9 @@ export async function installTheme(code: string): Promise { if (!theme) return; await addTheme(theme); } + +export function clearAppliedThemeCache() { + miLocalStorage.removeItem('theme'); + miLocalStorage.removeItem('themeId'); + miLocalStorage.removeItem('themeCachedVersion'); +} diff --git a/packages/frontend/src/utility/clear-cache.ts b/packages/frontend/src/utility/clear-cache.ts index 8f1f73466f..0e697edcac 100644 --- a/packages/frontend/src/utility/clear-cache.ts +++ b/packages/frontend/src/utility/clear-cache.ts @@ -9,14 +9,15 @@ import * as os from '@/os.js'; import { miLocalStorage } from '@/local-storage.js'; import { fetchCustomEmojis } from '@/custom-emojis.js'; import { fetchInstance } from '@/instance.js'; +import { clearAppliedThemeCache } from '@/theme.js'; export async function clearCache() { os.waiting(); miLocalStorage.removeItem('instance'); miLocalStorage.removeItem('instanceCachedAt'); - miLocalStorage.removeItem('theme'); miLocalStorage.removeItem('emojis'); miLocalStorage.removeItem('lastEmojisFetchedAt'); + clearAppliedThemeCache(); await misskeyApiGet('clear-browser-cache', {}).catch(() => { // ignore });