mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-29 12:16:39 +00:00
Add new confim dialog to automation editor (#4255)
This commit is contained in:
parent
36f49e66fd
commit
5458cda31f
@ -32,6 +32,7 @@ import {
|
|||||||
} from "../../../data/automation";
|
} from "../../../data/automation";
|
||||||
import { navigate } from "../../../common/navigate";
|
import { navigate } from "../../../common/navigate";
|
||||||
import { computeRTL } from "../../../common/util/compute_rtl";
|
import { computeRTL } from "../../../common/util/compute_rtl";
|
||||||
|
import { showConfirmationDialog } from "../../../dialogs/confirmation/show-dialog-confirmation";
|
||||||
|
|
||||||
function AutomationEditor(mountEl, props, mergeEl) {
|
function AutomationEditor(mountEl, props, mergeEl) {
|
||||||
return render(h(Automation, props), mountEl, mergeEl);
|
return render(h(Automation, props), mountEl, mergeEl);
|
||||||
@ -210,16 +211,19 @@ export class HaAutomationEditor extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _backTapped(): void {
|
private _backTapped(): void {
|
||||||
if (
|
if (this._dirty) {
|
||||||
this._dirty &&
|
showConfirmationDialog(this, {
|
||||||
!confirm(
|
text: this.hass!.localize(
|
||||||
this.hass!.localize("ui.panel.config.automation.editor.unsaved_confirm")
|
"ui.panel.config.automation.editor.unsaved_confirm"
|
||||||
)
|
),
|
||||||
) {
|
confirmBtnText: this.hass!.localize("ui.common.yes"),
|
||||||
return;
|
cancelBtnText: this.hass!.localize("ui.common.no"),
|
||||||
}
|
confirm: () => history.back(),
|
||||||
|
});
|
||||||
|
} else {
|
||||||
history.back();
|
history.back();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private async _delete() {
|
private async _delete() {
|
||||||
if (
|
if (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user