mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-27 14:57:20 +00:00
Fix dirty check/leaving automation editor (#10211)
This commit is contained in:
parent
b157cf5294
commit
5be475ea17
@ -443,7 +443,9 @@ export class HaAutomationEditor extends KeyboardShortcutMixin(LitElement) {
|
|||||||
),
|
),
|
||||||
confirmText: this.hass!.localize("ui.common.leave"),
|
confirmText: this.hass!.localize("ui.common.leave"),
|
||||||
dismissText: this.hass!.localize("ui.common.stay"),
|
dismissText: this.hass!.localize("ui.common.stay"),
|
||||||
confirm: () => history.back(),
|
confirm: () => {
|
||||||
|
setTimeout(() => history.back());
|
||||||
|
},
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
history.back();
|
history.back();
|
||||||
|
@ -267,7 +267,10 @@ export class HaManualAutomationEditor extends LitElement {
|
|||||||
const mode = ((ev.target as PaperListboxElement)?.selectedItem as any)
|
const mode = ((ev.target as PaperListboxElement)?.selectedItem as any)
|
||||||
?.mode;
|
?.mode;
|
||||||
|
|
||||||
if (mode === this.config!.mode) {
|
if (
|
||||||
|
mode === this.config!.mode ||
|
||||||
|
(!this.config!.mode && mode === MODES[0])
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const value = {
|
const value = {
|
||||||
|
@ -263,7 +263,7 @@ export default class HaAutomationTriggerRow extends LitElement {
|
|||||||
|
|
||||||
private _idChanged(ev: CustomEvent) {
|
private _idChanged(ev: CustomEvent) {
|
||||||
const newId = ev.detail.value;
|
const newId = ev.detail.value;
|
||||||
if (newId === this.trigger.id) {
|
if (newId === (this.trigger.id ?? "")) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const value = { ...this.trigger };
|
const value = { ...this.trigger };
|
||||||
|
@ -555,7 +555,7 @@ export class HaSceneEditor extends SubscribeMixin(
|
|||||||
try {
|
try {
|
||||||
config = await getSceneConfig(this.hass, this.sceneId!);
|
config = await getSceneConfig(this.hass, this.sceneId!);
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
showAlertDialog(this, {
|
await showAlertDialog(this, {
|
||||||
text:
|
text:
|
||||||
err.status_code === 404
|
err.status_code === 404
|
||||||
? this.hass.localize(
|
? this.hass.localize(
|
||||||
@ -566,7 +566,8 @@ export class HaSceneEditor extends SubscribeMixin(
|
|||||||
"err_no",
|
"err_no",
|
||||||
err.status_code
|
err.status_code
|
||||||
),
|
),
|
||||||
}).then(() => history.back());
|
});
|
||||||
|
history.back();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -586,7 +586,9 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) {
|
|||||||
),
|
),
|
||||||
confirmText: this.hass!.localize("ui.common.leave"),
|
confirmText: this.hass!.localize("ui.common.leave"),
|
||||||
dismissText: this.hass!.localize("ui.common.stay"),
|
dismissText: this.hass!.localize("ui.common.stay"),
|
||||||
confirm: () => history.back(),
|
confirm: () => {
|
||||||
|
setTimeout(() => history.back());
|
||||||
|
},
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
history.back();
|
history.back();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user