mirror of
https://github.com/fmhy/edit.git
synced 2026-01-13 23:41:06 +11:00
tf
This commit is contained in:
parent
e173b8a89e
commit
b41e6b3c9b
2 changed files with 3 additions and 25 deletions
|
|
@ -205,16 +205,6 @@ watch(selectedColor, async (color) => {
|
|||
if (!color) return;
|
||||
const theme = generateThemeFromColor(color)
|
||||
themeRegistry[`color-${color}`] = theme
|
||||
// Hopeful Fix For Preset Themes
|
||||
try {
|
||||
const key = 'vitepress-theme-data'
|
||||
const raw = localStorage.getItem(key)
|
||||
const parsed = raw ? JSON.parse(raw) as Record<string, any> : {}
|
||||
parsed[`color-${color}`] = theme
|
||||
localStorage.setItem(key, JSON.stringify(parsed))
|
||||
} catch (e) {
|
||||
// ignore storage errors
|
||||
}
|
||||
// Explicitly set the theme to override any previous selection
|
||||
await nextTick()
|
||||
console.log('Setting theme to:', `color-${color}`)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue