Fix automation/scripts dirty on start edit (#6474)
parent
cf7efb5bfc
commit
68e1378615
|
@ -411,6 +411,10 @@ export class HaAutomationEditor 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) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this._config = { ...this._config!, mode };
|
this._config = { ...this._config!, mode };
|
||||||
if (!MODES_MAX.includes(mode)) {
|
if (!MODES_MAX.includes(mode)) {
|
||||||
delete this._config.max;
|
delete this._config.max;
|
||||||
|
|
|
@ -306,6 +306,10 @@ export class HaScriptEditor 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) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this._config = { ...this._config!, mode };
|
this._config = { ...this._config!, mode };
|
||||||
if (!MODES_MAX.includes(mode)) {
|
if (!MODES_MAX.includes(mode)) {
|
||||||
delete this._config.max;
|
delete this._config.max;
|
||||||
|
|
Loading…
Reference in New Issue