fix(gpt-runner-web): optimize default theme
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { getGlobalConfig } from '../../helpers/global-config'
|
||||
import { gptrLightTheme } from './gptr-light.theme'
|
||||
import { gptrDarkTheme } from './gptr-dark.theme'
|
||||
import { jetbrainsDarkTheme } from './jetbrains-dark.theme'
|
||||
@@ -17,6 +18,11 @@ export const themeMap = {
|
||||
jetbrainsLight: jetbrainsLightTheme,
|
||||
} as const
|
||||
|
||||
if (getGlobalConfig().defaultTheme !== 'default') {
|
||||
const defaultTheme = themeMap[getGlobalConfig().defaultTheme] || themeMap.default
|
||||
;(themeMap as any).default = defaultTheme
|
||||
}
|
||||
|
||||
export function isDarkTheme(themeName: ThemeName) {
|
||||
const darkThemes: ThemeName[] = ['default', 'gptrDark', 'vscodeDynamic', 'vscodeDark', 'jetbrainsDark']
|
||||
return darkThemes.includes(themeName)
|
||||
|
||||
Reference in New Issue
Block a user