Fix issue where theme select does not appear when user's theme is deleted (#12104)

This commit is contained in:
Brynley McDonald 2022-03-25 04:31:55 +13:00 committed by GitHub
parent 859f49f3eb
commit 27ca61ec85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -173,6 +173,9 @@ export class HaPickThemeRow extends LitElement {
}
private _supportsModeSelection(themeName: string): boolean {
if (!(themeName in this.hass.themes.themes)) {
return false; // User's theme no longer exists
}
return "modes" in this.hass.themes.themes[themeName];
}