mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 09:16:38 +00:00
Recreate columns if cards change (#9480)
This commit is contained in:
parent
76daeb7e55
commit
805f5ff9b6
@ -127,6 +127,10 @@ export class MasonryView extends LitElement implements LovelaceViewElement {
|
|||||||
public willUpdate(changedProperties: PropertyValues) {
|
public willUpdate(changedProperties: PropertyValues) {
|
||||||
super.willUpdate(changedProperties);
|
super.willUpdate(changedProperties);
|
||||||
|
|
||||||
|
if (this.lovelace?.editMode) {
|
||||||
|
import("./default-view-editable");
|
||||||
|
}
|
||||||
|
|
||||||
if (changedProperties.has("hass")) {
|
if (changedProperties.has("hass")) {
|
||||||
const oldHass = changedProperties.get("hass") as
|
const oldHass = changedProperties.get("hass") as
|
||||||
| HomeAssistant
|
| HomeAssistant
|
||||||
@ -140,14 +144,7 @@ export class MasonryView extends LitElement implements LovelaceViewElement {
|
|||||||
|
|
||||||
if (changedProperties.has("narrow")) {
|
if (changedProperties.has("narrow")) {
|
||||||
this._updateColumns();
|
this._updateColumns();
|
||||||
}
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
protected updated(changedProperties: PropertyValues): void {
|
|
||||||
super.updated(changedProperties);
|
|
||||||
|
|
||||||
if (this.lovelace?.editMode) {
|
|
||||||
import("./default-view-editable");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const oldLovelace = changedProperties.get("lovelace") as
|
const oldLovelace = changedProperties.get("lovelace") as
|
||||||
@ -155,10 +152,11 @@ export class MasonryView extends LitElement implements LovelaceViewElement {
|
|||||||
| undefined;
|
| undefined;
|
||||||
|
|
||||||
if (
|
if (
|
||||||
changedProperties.has("lovelace") &&
|
changedProperties.has("cards") ||
|
||||||
oldLovelace &&
|
(changedProperties.has("lovelace") &&
|
||||||
(oldLovelace.config !== this.lovelace?.config ||
|
oldLovelace &&
|
||||||
oldLovelace.editMode !== this.lovelace?.editMode)
|
(oldLovelace.config !== this.lovelace!.config ||
|
||||||
|
oldLovelace.editMode !== this.lovelace!.editMode))
|
||||||
) {
|
) {
|
||||||
this._createColumns();
|
this._createColumns();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user