mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 17:26:42 +00:00
Fix initialization error in script/automation editors. (#699)
This commit is contained in:
parent
640e6eb1ef
commit
7cfa694980
@ -166,20 +166,29 @@ class HaAutomationEditor extends window.hassMixins.EventsMixin(Polymer.Element)
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
observer: '_updateComponent',
|
observer: '_updateComponent',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_rendered: {
|
||||||
|
type: Object,
|
||||||
|
value: null,
|
||||||
|
},
|
||||||
|
|
||||||
|
_renderScheduled: {
|
||||||
|
type: Boolean,
|
||||||
|
value: false,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
ready() {
|
ready() {
|
||||||
super.ready();
|
|
||||||
this.configChanged = this.configChanged.bind(this);
|
this.configChanged = this.configChanged.bind(this);
|
||||||
this._rendered = null;
|
super.ready(); // This call will initialize preact.
|
||||||
this._renderScheduled = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
disconnectedCallback() {
|
disconnectedCallback() {
|
||||||
super.disconnectedCallback();
|
super.disconnectedCallback();
|
||||||
if (this._rendered) {
|
if (this._rendered) {
|
||||||
window.unmountPreact(this._rendered);
|
window.unmountPreact(this._rendered);
|
||||||
|
this._rendered = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,19 +161,24 @@ class HaScriptEditor extends window.hassMixins.EventsMixin(Polymer.Element) {
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
observer: 'isWideChanged',
|
observer: 'isWideChanged',
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_rendered: {
|
||||||
|
type: Object,
|
||||||
|
value: null,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
ready() {
|
ready() {
|
||||||
super.ready();
|
|
||||||
this.configChanged = this.configChanged.bind(this);
|
this.configChanged = this.configChanged.bind(this);
|
||||||
this._rendered = null;
|
super.ready(); // This call will initialize preact.
|
||||||
}
|
}
|
||||||
|
|
||||||
disconnectedCallback() {
|
disconnectedCallback() {
|
||||||
super.disconnectedCallback();
|
super.disconnectedCallback();
|
||||||
if (this._rendered) {
|
if (this._rendered) {
|
||||||
window.unmountPreact(this._rendered);
|
window.unmountPreact(this._rendered);
|
||||||
|
this._rendered = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user