mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-28 19:56:42 +00:00
Add id = 0 handling (#2201)
* Add id = 0 handling * Add check in view creation
This commit is contained in:
parent
647a33ea61
commit
f600b0522c
@ -28,7 +28,8 @@ export class HuiViewEditor extends hassLocalizeLitMixin(LitElement) {
|
||||
if (!this._config) {
|
||||
return "";
|
||||
}
|
||||
return this._config.id || "";
|
||||
|
||||
return "id" in this._config ? this._config.id! : "";
|
||||
}
|
||||
|
||||
get _title(): string {
|
||||
|
@ -42,7 +42,7 @@ export class HuiDialogEditView extends LitElement {
|
||||
if (
|
||||
!this._params.add &&
|
||||
this._params.viewConfig &&
|
||||
!this._params.viewConfig.id
|
||||
!("id" in this._params.viewConfig)
|
||||
) {
|
||||
return html`
|
||||
<hui-migrate-config
|
||||
|
@ -119,7 +119,7 @@ class HUIView extends localizeMixin(EventsMixin(PolymerElement)) {
|
||||
|
||||
_addCard() {
|
||||
showEditCardDialog(this, {
|
||||
viewId: this.config.id,
|
||||
viewId: "id" in this.config ? String(this.config.id) : undefined,
|
||||
add: true,
|
||||
reloadLovelace: () => {
|
||||
this.fire("config-refresh");
|
||||
|
Loading…
x
Reference in New Issue
Block a user