From 4669decfd0e52af385b9ac3d4562e39bc2cc4f14 Mon Sep 17 00:00:00 2001 From: karwosts <32912880+karwosts@users.noreply.github.com> Date: Sun, 20 Oct 2024 23:56:46 -0700 Subject: [PATCH] Fix label filters from URL (#22447) --- src/panels/config/devices/ha-config-devices-dashboard.ts | 8 +++----- src/panels/config/entities/ha-config-entities.ts | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/panels/config/devices/ha-config-devices-dashboard.ts b/src/panels/config/devices/ha-config-devices-dashboard.ts index b6493252c49b..5500750d6561 100644 --- a/src/panels/config/devices/ha-config-devices-dashboard.ts +++ b/src/panels/config/devices/ha-config-devices-dashboard.ts @@ -223,8 +223,9 @@ export class HaConfigDeviceDashboard extends SubscribeMixin(LitElement) { private _setFiltersFromUrl() { const domain = this._searchParms.get("domain"); const configEntry = this._searchParms.get("config_entry"); + const label = this._searchParms.has("label"); - if (!domain && !configEntry) { + if (!domain && !configEntry && !label) { return; } @@ -247,10 +248,7 @@ export class HaConfigDeviceDashboard extends SubscribeMixin(LitElement) { items: undefined, }, }; - - if (this._searchParms.has("label")) { - this._filterLabel(); - } + this._filterLabel(); } private _filterLabel() { diff --git a/src/panels/config/entities/ha-config-entities.ts b/src/panels/config/entities/ha-config-entities.ts index 50466f24300c..e828e7b6e101 100644 --- a/src/panels/config/entities/ha-config-entities.ts +++ b/src/panels/config/entities/ha-config-entities.ts @@ -1013,8 +1013,9 @@ ${ private _setFiltersFromUrl() { const domain = this._searchParms.get("domain"); const configEntry = this._searchParms.get("config_entry"); + const label = this._searchParms.has("label"); - if (!domain && !configEntry) { + if (!domain && !configEntry && !label) { return; } @@ -1025,10 +1026,7 @@ ${ "ha-filter-integrations": domain ? [domain] : [], config_entry: configEntry ? [configEntry] : [], }; - - if (this._searchParms.has("label")) { - this._filterLabel(); - } + this._filterLabel(); } private _filterLabel() {