kill everyone

This commit is contained in:
fmhyhalloweenshit 2026-01-02 15:16:02 +03:00 committed by GitHub
parent caacdaa10d
commit 884d63e3c6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 4 deletions

View file

@ -26,7 +26,7 @@ export class ThemeHandler {
private state = ref<ThemeState>({
currentTheme: 'color-swarm',
currentMode: 'light' as DisplayMode,
theme: themeRegistry['color-swarm']
theme: null
})
private amoledEnabled = ref(false)
@ -77,6 +77,10 @@ export class ThemeHandler {
if (typeof document === 'undefined') return
const { currentMode, theme } = this.state.value
if (!theme) {
this.applyDOMClasses(currentMode)
return
}
const modeColors = theme.modes[currentMode]
this.applyDOMClasses(currentMode)
@ -309,9 +313,11 @@ export class ThemeHandler {
}
private ensureColorPickerColors() {
const theme = this.state.value.theme
if (!theme) return
// If theme doesn't specify brand colors, force ColorPicker to reapply its selection
const currentMode = this.state.value.currentMode
const modeColors = this.state.value.theme.modes[currentMode]
const modeColors = theme.modes[currentMode]
if (!modeColors.brand || !modeColors.brand[1]) {
// Trigger a custom event that ColorPicker can listen to

View file

@ -130,5 +130,5 @@ export interface ThemeRegistry {
export interface ThemeState {
currentTheme: string
currentMode: DisplayMode
theme: Theme
theme: Theme | null
}