mirror of
https://github.com/fmhy/edit.git
synced 2026-01-12 15:01:06 +11:00
Fix for preset themes not saving (#4465)
* shitty (probably not working) fix for preset themes * tf * i saved theme data locally fuck * 99% chance this wont work * make default christmas
This commit is contained in:
parent
09e43b4954
commit
968a775e7b
2 changed files with 11 additions and 5 deletions
|
|
@ -8,7 +8,7 @@ import type { Theme } from '../themes/types'
|
|||
import Switch from './Switch.vue'
|
||||
|
||||
type ColorNames = keyof typeof colors
|
||||
const selectedColor = useStorage<ColorNames>('preferred-color', 'swarm')
|
||||
const selectedColor = useStorage<ColorNames>('preferred-color', 'christmas')
|
||||
|
||||
// Use the theme system
|
||||
const { amoledEnabled, setAmoledEnabled, setTheme, state, mode, themeName } = useTheme()
|
||||
|
|
@ -196,7 +196,13 @@ const normalizeColorName = (colorName: string) =>
|
|||
colorName.slice(1).replaceAll(/-/g, ' ')
|
||||
|
||||
onMounted(async () => {
|
||||
// Don't auto-apply color theme - only apply when user explicitly selects
|
||||
// apply saved theme on load
|
||||
if (selectedColor.value) {
|
||||
const theme = generateThemeFromColor(selectedColor.value)
|
||||
themeRegistry[`color-${selectedColor.value}`] = theme
|
||||
await nextTick()
|
||||
setTheme(`color-${selectedColor.value}`)
|
||||
}
|
||||
// Wait for next tick to ensure theme handler is fully initialized
|
||||
await nextTick()
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue