mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Reload the card when changing the configuration in editor (#21351)
This commit is contained in:
parent
7edc4efc95
commit
daa36788e0
@ -150,8 +150,10 @@ export class HuiCard extends ReactiveElement {
|
||||
if (changedProps.has("config")) {
|
||||
const elementConfig = this._elementConfig;
|
||||
if (this.config !== elementConfig && this.config) {
|
||||
const typeChanged = this.config?.type !== elementConfig?.type;
|
||||
if (typeChanged) {
|
||||
const typeChanged =
|
||||
this.config?.type !== elementConfig?.type || this.preview;
|
||||
// Rebuild the card if the type of the card has changed or if we are in preview mode
|
||||
if (typeChanged || this.preview) {
|
||||
this._loadElement(this.config);
|
||||
} else {
|
||||
this._updateElement(this.config);
|
||||
|
Loading…
x
Reference in New Issue
Block a user