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

@@ -18,6 +18,7 @@ import {
LitElement,
PropertyValues,
TemplateResult,
nothing,
} from "lit";
import { property, query, state } from "lit/decorators";
import { classMap } from "lit/directives/class-map";
@@ -42,9 +43,9 @@ import type { HaYamlEditor } from "../../../components/ha-yaml-editor";
import { EntityRegistryEntry } from "../../../data/entity_registry";
import {
deleteScript,
getScriptStateConfig,
fetchScriptFileConfig,
getScriptEditorInitData,
getScriptStateConfig,
isMaxMode,
MODES,
MODES_MAX,
@@ -157,9 +158,9 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) {
] as const
);
protected render(): TemplateResult {
protected render() {
if (!this._config) {
return html``;
return nothing;
}
const schema = this._schema(