From 3984702d3eba9fde82c405fcea2a60cedc75a961 Mon Sep 17 00:00:00 2001
From: karwosts <32912880+karwosts@users.noreply.github.com>
Date: Wed, 3 Jan 2024 11:36:59 -0800
Subject: [PATCH] Fix select view dialog (#19267)
* Fix select view dialog
* add import
---
.../select-view/hui-dialog-select-view.ts | 21 ++++++++++++++-----
src/translations/en.json | 4 +++-
2 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/src/panels/lovelace/editor/select-view/hui-dialog-select-view.ts b/src/panels/lovelace/editor/select-view/hui-dialog-select-view.ts
index 6a9c8eb04f..5f3e073f3a 100644
--- a/src/panels/lovelace/editor/select-view/hui-dialog-select-view.ts
+++ b/src/panels/lovelace/editor/select-view/hui-dialog-select-view.ts
@@ -8,6 +8,7 @@ import { stopPropagation } from "../../../../common/dom/stop_propagation";
import { createCloseHeading } from "../../../../components/ha-dialog";
import "../../../../components/ha-icon";
import "../../../../components/ha-select";
+import "../../../../components/ha-alert";
import {
fetchConfig,
LovelaceConfig,
@@ -104,8 +105,15 @@ export class HuiDialogSelectView extends LitElement {
})}
`
: ""}
- ${this._config
- ? this._config.views.length > 1
+ ${!this._config || (this._config.views || []).length < 1
+ ? html`