mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-09 02:49:51 +00:00
Save data table filters in session storage (#20894)
* Save data table filters in session storage * typing fix * remove url logic, rename storage key
This commit is contained in:
@@ -42,6 +42,9 @@ export class HaFilterEntities extends LitElement {
|
||||
|
||||
if (!this.hasUpdated) {
|
||||
loadVirtualizer();
|
||||
if (this.value?.length) {
|
||||
this._findRelated();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -186,15 +189,12 @@ export class HaFilterEntities extends LitElement {
|
||||
return;
|
||||
}
|
||||
|
||||
const value: string[] = [];
|
||||
|
||||
for (const entityId of this.value) {
|
||||
value.push(entityId);
|
||||
if (this.type) {
|
||||
relatedPromises.push(findRelated(this.hass, "entity", entityId));
|
||||
}
|
||||
}
|
||||
this.value = value;
|
||||
|
||||
const results = await Promise.all(relatedPromises);
|
||||
const items: Set<string> = new Set();
|
||||
for (const result of results) {
|
||||
@@ -204,7 +204,7 @@ export class HaFilterEntities extends LitElement {
|
||||
}
|
||||
|
||||
fireEvent(this, "data-table-filter-changed", {
|
||||
value,
|
||||
value: this.value,
|
||||
items: this.type ? items : undefined,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user