Skip to content

Commit

Permalink
Avoid nested blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
amitfin committed Nov 28, 2023
1 parent d6fd784 commit 8f9f365
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/panels/lovelace/cards/hui-map-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,15 @@ class HuiMapCard extends LitElement implements LovelaceCard {

protected willUpdate(changedProps: PropertyValues): void {
super.willUpdate(changedProps);
if (changedProps.has("hass") && this._config?.geo_location_sources) {
if (
!deepEqual(
this._getSourceEntities(changedProps.get("hass")?.states),
this._getSourceEntities(this.hass.states)
)
) {
this._mapEntities = this._getMapEntities();
}
if (
changedProps.has("hass") &&
this._config?.geo_location_sources &&
!deepEqual(
this._getSourceEntities(changedProps.get("hass")?.states),
this._getSourceEntities(this.hass.states)
)
) {
this._mapEntities = this._getMapEntities();
}
}

Expand Down

0 comments on commit 8f9f365

Please sign in to comment.