feat: gracefully handle missing background themes
Fallback to a hardcoded default theme instead of returning null when the configured theme and the 'classic' fallback are both missing. This prevents potential UI glitches.
This commit is contained in:
@@ -1549,10 +1549,10 @@ function getGradient(ctx, height) {
|
||||
return cachedGradient;
|
||||
}
|
||||
|
||||
const theme = BACKGROUND_THEMES[colorTheme] || BACKGROUND_THEMES.classic;
|
||||
let theme = BACKGROUND_THEMES[colorTheme] || BACKGROUND_THEMES.classic;
|
||||
if (!theme) {
|
||||
console.warn("No theme found for", colorTheme);
|
||||
return null;
|
||||
console.warn("No theme found for", colorTheme, "- falling back to default");
|
||||
theme = { top: '#05004c', bottom: '#110E19', star: '#ffffff' };
|
||||
}
|
||||
|
||||
const gradient = ctx.createLinearGradient(0, 0, 0, height);
|
||||
|
||||
Reference in New Issue
Block a user