summaryrefslogtreecommitdiff
path: root/packages/frontend/src/theme.ts
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2025-10-22 11:11:30 +0900
committersyuilo <4439005+syuilo@users.noreply.github.com>2025-10-22 11:11:30 +0900
commitf0380f2d1c2afd9ce8d0be9479a23fca0b4ccdc6 (patch)
treeaf8d118e671b81d671abd5171a3cb5ff29d4f4bc /packages/frontend/src/theme.ts
parentBump version to 2025.10.1-beta.1 (diff)
downloadmisskey-f0380f2d1c2afd9ce8d0be9479a23fca0b4ccdc6.tar.gz
misskey-f0380f2d1c2afd9ce8d0be9479a23fca0b4ccdc6.tar.bz2
misskey-f0380f2d1c2afd9ce8d0be9479a23fca0b4ccdc6.zip
enhance(frontend): improve theme apply handling
Diffstat (limited to 'packages/frontend/src/theme.ts')
-rw-r--r--packages/frontend/src/theme.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/frontend/src/theme.ts b/packages/frontend/src/theme.ts
index 7cbaf87243..13f5dbf60e 100644
--- a/packages/frontend/src/theme.ts
+++ b/packages/frontend/src/theme.ts
@@ -10,6 +10,7 @@ import tinycolor from 'tinycolor2';
import lightTheme from '@@/themes/_light.json5';
import darkTheme from '@@/themes/_dark.json5';
import JSON5 from 'json5';
+import { version } from '@@/js/config.js';
import type { Ref } from 'vue';
import type { BundledTheme } from 'shiki/themes';
import { deepClone } from '@/utility/clone.js';
@@ -123,6 +124,7 @@ function applyThemeInternal(theme: Theme, persist: boolean) {
if (persist) {
miLocalStorage.setItem('theme', JSON.stringify(props));
miLocalStorage.setItem('themeId', theme.id);
+ miLocalStorage.setItem('themeCachedVersion', version);
miLocalStorage.setItem('colorScheme', colorScheme);
}
@@ -139,7 +141,7 @@ export function applyTheme(theme: Theme, persist = true) {
timeout = null;
}
- if (theme.id === currentThemeId) return;
+ if (theme.id === currentThemeId && miLocalStorage.getItem('themeCachedVersion') === version) return;
currentThemeId = theme.id;
if (window.document.startViewTransition != null) {