mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +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")) {
|
if (changedProps.has("config")) {
|
||||||
const elementConfig = this._elementConfig;
|
const elementConfig = this._elementConfig;
|
||||||
if (this.config !== elementConfig && this.config) {
|
if (this.config !== elementConfig && this.config) {
|
||||||
const typeChanged = this.config?.type !== elementConfig?.type;
|
const typeChanged =
|
||||||
if (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);
|
this._loadElement(this.config);
|
||||||
} else {
|
} else {
|
||||||
this._updateElement(this.config);
|
this._updateElement(this.config);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user