mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-10 03:19:44 +00:00
Prefer nothing over empty templates (#15633)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { HassEntity } from "home-assistant-js-websocket";
|
||||
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
|
||||
import { css, CSSResultGroup, html, LitElement, nothing } from "lit";
|
||||
import { customElement, property } from "lit/decorators";
|
||||
import "../../../components/ha-relative-time";
|
||||
import { HomeAssistant } from "../../../types";
|
||||
@@ -10,9 +10,9 @@ class MoreInfoScript extends LitElement {
|
||||
|
||||
@property() public stateObj?: HassEntity;
|
||||
|
||||
protected render(): TemplateResult {
|
||||
protected render() {
|
||||
if (!this.hass || !this.stateObj) {
|
||||
return html``;
|
||||
return nothing;
|
||||
}
|
||||
|
||||
return html`
|
||||
|
||||
Reference in New Issue
Block a user