Prefer nothing over empty templates (#15633)

This commit is contained in:
Steve Repsher
2023-02-28 05:02:47 -05:00
committed by GitHub
parent 4031d9cc78
commit 9ce4563dd4
362 changed files with 1533 additions and 1435 deletions

View File

@@ -12,7 +12,7 @@ import {
html,
LitElement,
PropertyValues,
TemplateResult,
nothing,
} from "lit";
import { customElement, property, query, state } from "lit/decorators";
import { classMap } from "lit/directives/class-map";
@@ -86,9 +86,9 @@ export class HaVoiceCommandDialog extends LitElement {
fireEvent(this, "dialog-closed", { dialog: this.localName });
}
protected render(): TemplateResult {
protected render() {
if (!this._opened) {
return html``;
return nothing;
}
return html`
<ha-dialog