fix(frontend): キャッシュをクリアするとテーマ再適用するまでレンダリングが正しく行われない問題を修正
This commit is contained in:
parent
4ff826eb3d
commit
9f768b8022
|
|
@ -4,7 +4,7 @@
|
|||
-
|
||||
|
||||
### Client
|
||||
-
|
||||
- Fix: キャッシュをクリアするとテーマ再適用するまでレンダリングが正しく行われない問題を修正
|
||||
|
||||
### Server
|
||||
-
|
||||
|
|
|
|||
|
|
@ -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');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue