fix(frontend): キャッシュをクリアするとテーマ再適用するまでレンダリングが正しく行われない問題を修正

This commit is contained in:
syuilo 2025-10-25 08:22:47 +09:00
parent 4ff826eb3d
commit 9f768b8022
3 changed files with 9 additions and 2 deletions

View File

@ -4,7 +4,7 @@
-
### Client
-
- Fix: キャッシュをクリアするとテーマ再適用するまでレンダリングが正しく行われない問題を修正
### Server
-

View File

@ -242,3 +242,9 @@ export async function installTheme(code: string): Promise<void> {
if (!theme) return;
await addTheme(theme);
}
export function clearAppliedThemeCache() {
miLocalStorage.removeItem('theme');
miLocalStorage.removeItem('themeId');
miLocalStorage.removeItem('themeCachedVersion');
}

View File

@ -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
});