mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 15:26:36 +00:00
Use original id to remove entity (#4829)
This commit is contained in:
parent
e7e8dff0ec
commit
2c006e99f2
@ -177,26 +177,27 @@ export class EntityRegistrySettings extends LitElement {
|
||||
}
|
||||
}
|
||||
|
||||
private async _deleteEntry(): Promise<void> {
|
||||
private async _confirmDeleteEntry(): Promise<void> {
|
||||
if (
|
||||
!(await showConfirmationDialog(this, {
|
||||
text: this.hass.localize(
|
||||
"ui.dialogs.entity_registry.editor.confirm_delete"
|
||||
),
|
||||
}))
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._submitting = true;
|
||||
|
||||
try {
|
||||
await removeEntityRegistryEntry(this.hass!, this._entityId);
|
||||
await removeEntityRegistryEntry(this.hass!, this._origEntityId);
|
||||
fireEvent(this as HTMLElement, "close-dialog");
|
||||
} finally {
|
||||
this._submitting = false;
|
||||
}
|
||||
}
|
||||
|
||||
private _confirmDeleteEntry(): void {
|
||||
showConfirmationDialog(this, {
|
||||
text: this.hass.localize(
|
||||
"ui.dialogs.entity_registry.editor.confirm_delete"
|
||||
),
|
||||
confirm: () => this._deleteEntry(),
|
||||
});
|
||||
}
|
||||
|
||||
private _disabledByChanged(ev: Event): void {
|
||||
this._disabledBy = (ev.target as HaSwitch).checked ? null : "user";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user