Fix so legacy custom themes still load. (#4757)

Co-authored-by: matt korwel <matt.korwel@gmail.com>
This commit is contained in:
Jacob Richman
2025-07-25 17:36:42 -07:00
committed by GitHub
parent b089845f1c
commit ad2ef080aa
3 changed files with 183 additions and 6 deletions

View File

@@ -75,8 +75,18 @@ class ThemeManager {
)) {
const validation = validateCustomTheme(customThemeConfig);
if (validation.isValid) {
if (validation.warning) {
console.warn(`Theme "${name}": ${validation.warning}`);
}
const themeWithDefaults: CustomTheme = {
...DEFAULT_THEME.colors,
...customThemeConfig,
name: customThemeConfig.name || name,
type: 'custom',
};
try {
const theme = createCustomTheme(customThemeConfig);
const theme = createCustomTheme(themeWithDefaults);
this.customThemes.set(name, theme);
} catch (error) {
console.warn(`Failed to load custom theme "${name}":`, error);