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:
committed by
Bram Kragten
parent
457c51cf58
commit
465c10b945
@@ -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" : "";
|
||||
|
||||
@@ -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" : "";
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user