mirror of
https://github.com/home-assistant/frontend.git
synced 2026-04-02 00:27:49 +01:00
Simplify ll-rebuild for section
This commit is contained in:
@@ -35,7 +35,6 @@ import {
|
||||
extractSearchParamsObject,
|
||||
removeSearchParam,
|
||||
} from "../../common/url/search-params";
|
||||
import { debounce } from "../../common/util/debounce";
|
||||
import { afterNextRender } from "../../common/util/render-status";
|
||||
import "../../components/ha-button";
|
||||
import "../../components/ha-dropdown";
|
||||
@@ -170,28 +169,10 @@ class HUIRoot extends LitElement {
|
||||
}),
|
||||
});
|
||||
|
||||
private _debouncedConfigChanged: () => void;
|
||||
|
||||
private _conversation = memoizeOne((_components) =>
|
||||
isComponentLoaded(this.hass, "conversation")
|
||||
);
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
// The view can trigger a re-render when it knows that certain
|
||||
// web components have been loaded.
|
||||
this._debouncedConfigChanged = debounce(
|
||||
() => {
|
||||
// Reset current view to force re-creation on ll-rebuild in edit mode
|
||||
const curView = this._curView;
|
||||
this._curView = undefined;
|
||||
this._selectView(curView);
|
||||
},
|
||||
100,
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
private _renderActionItems(): TemplateResult {
|
||||
const result: TemplateResult[] = [];
|
||||
|
||||
@@ -637,7 +618,6 @@ class HUIRoot extends LitElement {
|
||||
.hass=${this.hass}
|
||||
.theme=${curViewConfig?.theme}
|
||||
id="view"
|
||||
@ll-rebuild=${this._debouncedConfigChanged}
|
||||
>
|
||||
<hui-view-background .hass=${this.hass} .background=${background}>
|
||||
</hui-view-background>
|
||||
|
||||
@@ -140,11 +140,8 @@ export class HUIView extends ReactiveElement {
|
||||
element.addEventListener(
|
||||
"ll-rebuild",
|
||||
(ev: Event) => {
|
||||
// In edit mode let it go to hui-root and rebuild whole view.
|
||||
if (!this.lovelace!.editMode) {
|
||||
ev.stopPropagation();
|
||||
this._rebuildSection(element, sectionConfig);
|
||||
}
|
||||
ev.stopPropagation();
|
||||
this._rebuildSection(element, sectionConfig);
|
||||
},
|
||||
{ once: true }
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user