summaryrefslogtreecommitdiff
path: root/packages/frontend
diff options
context:
space:
mode:
Diffstat (limited to 'packages/frontend')
-rw-r--r--packages/frontend/src/theme.ts6
-rw-r--r--packages/frontend/src/utility/clear-cache.ts3
2 files changed, 8 insertions, 1 deletions
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<void> {
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
});