mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-30 20:56:36 +00:00
Add suggested name
This commit is contained in:
parent
31c6247a86
commit
960e0dd9e0
@ -34,8 +34,13 @@ class DialogCategoryDetail extends LitElement {
|
||||
): Promise<void> {
|
||||
this._params = params;
|
||||
this._error = undefined;
|
||||
this._name = this._params.entry ? this._params.entry.name : "";
|
||||
this._icon = this._params.entry?.icon || null;
|
||||
if (this._params.entry) {
|
||||
this._name = this._params.entry.name || "";
|
||||
this._icon = this._params.entry.icon || null;
|
||||
} else {
|
||||
this._name = this._params.suggestedName || "";
|
||||
this._icon = null;
|
||||
}
|
||||
await this.updateComplete;
|
||||
}
|
||||
|
||||
|
@ -237,6 +237,7 @@ export class HaCategoryPicker extends SubscribeMixin(LitElement) {
|
||||
|
||||
showCategoryRegistryDetailDialog(this, {
|
||||
scope: this.scope!,
|
||||
suggestedName: newValue === ADD_NEW_SUGGESTION_ID ? this._suggestion : "",
|
||||
createEntry: async (values) => {
|
||||
const category = await createCategoryRegistryEntry(
|
||||
this.hass,
|
||||
|
Loading…
x
Reference in New Issue
Block a user