mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Fix closing hui-editor (#5132)
This commit is contained in:
parent
e5db86363c
commit
dbdbad2deb
@ -166,21 +166,23 @@ class LovelaceFullConfigEditor extends LitElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private _closeEditor() {
|
private async _closeEditor() {
|
||||||
if (this._changed) {
|
if (
|
||||||
showConfirmationDialog(this, {
|
this._changed &&
|
||||||
|
!(await showConfirmationDialog(this, {
|
||||||
text: this.hass.localize(
|
text: this.hass.localize(
|
||||||
"ui.panel.lovelace.editor.raw_editor.confirm_unsaved_changes"
|
"ui.panel.lovelace.editor.raw_editor.confirm_unsaved_changes"
|
||||||
),
|
),
|
||||||
dismissText: this.hass!.localize("ui.common.no"),
|
dismissText: this.hass!.localize("ui.common.no"),
|
||||||
confirmText: this.hass!.localize("ui.common.yes"),
|
confirmText: this.hass!.localize("ui.common.yes"),
|
||||||
confirm: () => {
|
}))
|
||||||
window.onbeforeunload = null;
|
) {
|
||||||
if (this.closeEditor) {
|
return;
|
||||||
this.closeEditor();
|
}
|
||||||
}
|
|
||||||
},
|
window.onbeforeunload = null;
|
||||||
});
|
if (this.closeEditor) {
|
||||||
|
this.closeEditor();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user