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

@@ -1,6 +1,5 @@
import "../ha-header-bar";
import { mdiArrowLeft, mdiClose } from "@mdi/js";
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
import { css, CSSResultGroup, html, LitElement, nothing } from "lit";
import { customElement, property, query, state } from "lit/decorators";
import { fireEvent, HASSDomEvent } from "../../common/dom/fire_event";
import { computeRTLDirection } from "../../common/util/compute_rtl";
@@ -12,8 +11,9 @@ import type {
import { haStyleDialog } from "../../resources/styles";
import type { HomeAssistant } from "../../types";
import "../ha-dialog";
import "./ha-media-player-browse";
import "../ha-header-bar";
import "./ha-media-manage-button";
import "./ha-media-player-browse";
import type {
HaMediaPlayerBrowse,
MediaPlayerItemId,
@@ -49,9 +49,9 @@ class DialogMediaPlayerBrowse extends LitElement {
fireEvent(this, "dialog-closed", { dialog: this.localName });
}
protected render(): TemplateResult {
protected render() {
if (!this._params || !this._navigateIds) {
return html``;
return nothing;
}
return html`