diff --git a/src/panels/lovelace/editor/view-editor/hui-view-editor.ts b/src/panels/lovelace/editor/view-editor/hui-view-editor.ts index d0c4f24d53..803cdea063 100644 --- a/src/panels/lovelace/editor/view-editor/hui-view-editor.ts +++ b/src/panels/lovelace/editor/view-editor/hui-view-editor.ts @@ -95,12 +95,16 @@ export class HuiViewEditor extends LitElement { : this._config.type || DEFAULT_VIEW_LAYOUT; } + private get _isEmpty(): boolean { + return !this._config.sections?.length && !this._config.cards?.length; + } + protected render() { if (!this.hass) { return nothing; } - const schema = this._schema(this.hass.localize, this._type, this.isNew); + const schema = this._schema(this.hass.localize, this._type, this._isEmpty); const data = { ...this._config, @@ -165,7 +169,7 @@ export class HuiViewEditor extends LitElement { "ui.panel.lovelace.editor.edit_view.subview_helper" ); case "type": - if (this.isNew) return undefined; + if (this._isEmpty) return undefined; return this._type === "sections" ? this.hass.localize( "ui.panel.lovelace.editor.edit_view.type_helper_others" diff --git a/src/translations/en.json b/src/translations/en.json index 24f63e86a3..c8c1b42c79 100644 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -5112,7 +5112,7 @@ "select_users": "Select which users should see this view in the navigation" }, "type": "View type", - "type_helper_sections": "You can not change your view to use the 'sections' view type, because migration is not supported yet. Start from scratch with a new view if you want to experiment with the 'sections' view.", + "type_helper_sections": "You can not change your view to use the 'sections' view type because migration is not supported yet. Start from scratch with a new view if you want to experiment with the 'sections' view.", "type_helper_others": "You can not change your view to an other type because migration is not supported yet. Start from scratch with a new view if you want to use another view type.", "types": {