Fix filter card visibility when show empty is false (#20985)

This commit is contained in:
Paul Bottein 2024-06-04 16:46:38 +02:00 committed by GitHub
parent ab340e13e9
commit db82b856e0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -163,14 +163,12 @@ export class HuiEntityFilterCard
return false;
});
if (
entitiesList.length === 0 &&
this._config.show_empty === false &&
!this.hidden
) {
this.style.display = "none";
this.toggleAttribute("hidden", true);
fireEvent(this, "card-visibility-changed", { value: false });
if (entitiesList.length === 0 && this._config.show_empty === false) {
if (!this.hidden) {
this.style.display = "none";
this.toggleAttribute("hidden", true);
fireEvent(this, "card-visibility-changed", { value: false });
}
return;
}