Skip to content

Commit

Permalink
Fix automation/scripts dirty on start edit (#6474)
Browse files Browse the repository at this point in the history
  • Loading branch information
bramkragten committed Jul 28, 2020
1 parent cf7efb5 commit 68e1378
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/panels/config/automation/ha-automation-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions src/panels/config/script/ha-script-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 68e1378

Please sign in to comment.