1
0
mirror of https://github.com/home-assistant/frontend.git synced 2026-04-02 00:27:49 +01:00

Fix updates, discovered devices and repairs cards flickering (#29935)

This commit is contained in:
Paul Bottein
2026-03-02 14:50:42 +01:00
committed by Bram Kragten
parent 457c51cf58
commit 465c10b945
3 changed files with 10 additions and 7 deletions

View File

@@ -131,9 +131,10 @@ export class HuiDiscoveredDevicesCard
}
// Update visibility based on admin status and discovered devices count
const shouldBeHidden =
const shouldBeHidden = Boolean(
!this.hass.user?.is_admin ||
(this._config.hide_empty && this._discoveredFlows.length === 0);
(this._config.hide_empty && this._discoveredFlows.length === 0)
);
if (shouldBeHidden !== this.hidden) {
this.style.display = shouldBeHidden ? "none" : "";

View File

@@ -97,9 +97,10 @@ export class HuiRepairsCard
}
// Update visibility based on admin status and repairs count
const shouldBeHidden =
const shouldBeHidden = Boolean(
!this.hass.user?.is_admin ||
(this._config.hide_empty && this._repairsIssues.length === 0);
(this._config.hide_empty && this._repairsIssues.length === 0)
);
if (shouldBeHidden !== this.hidden) {
this.style.display = shouldBeHidden ? "none" : "";

View File

@@ -91,9 +91,10 @@ export class HuiUpdatesCard extends LitElement implements LovelaceCard {
const updateEntities = this._getUpdateEntities();
// Update visibility based on admin status and updates count
const shouldBeHidden =
const shouldBeHidden = Boolean(
!this.hass.user?.is_admin ||
(this._config.hide_empty && updateEntities.length === 0);
(this._config.hide_empty && updateEntities.length === 0)
);
if (shouldBeHidden !== this.hidden) {
this.style.display = shouldBeHidden ? "none" : "";
@@ -103,7 +104,7 @@ export class HuiUpdatesCard extends LitElement implements LovelaceCard {
}
protected render(): TemplateResult | typeof nothing {
if (!this._config || !this.hass || this.hidden) {
if (!this._config || !this.hass) {
return nothing;
}