Fix automation/scripts dirty on start edit (#6474)

This commit is contained in:
Bram Kragten 2020-07-28 11:12:58 +02:00 committed by GitHub
parent cf7efb5bfc
commit 68e1378615
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -411,6 +411,10 @@ export class HaAutomationEditor extends LitElement {
const mode = ((ev.target as PaperListboxElement)?.selectedItem as any)
?.mode;
if (mode === this._config!.mode) {
return;
}
this._config = { ...this._config!, mode };
if (!MODES_MAX.includes(mode)) {
delete this._config.max;

View File

@ -306,6 +306,10 @@ export class HaScriptEditor extends LitElement {
const mode = ((ev.target as PaperListboxElement)?.selectedItem as any)
?.mode;
if (mode === this._config!.mode) {
return;
}
this._config = { ...this._config!, mode };
if (!MODES_MAX.includes(mode)) {
delete this._config.max;