FIX: Don't call cooked decorators in composer if cooked is unchanged

If cooked is unchanged, ember will not re-render the preview area, so we should not re-run the post-processing decorators. This can cause issues when decorateCooked functions are not idempotent.
This commit is contained in:
David Taylor 2020-06-09 23:01:07 +01:00
parent f67e7d2fad
commit 9e98c02dd7
No known key found for this signature in database
GPG Key ID: 46904C18B1D3F434
1 changed files with 3 additions and 0 deletions

View File

@ -367,6 +367,9 @@ export default Component.extend({
if (this.isDestroyed) { if (this.isDestroyed) {
return; return;
} }
if (this.preview === cooked) return;
this.set("preview", cooked); this.set("preview", cooked);
schedule("afterRender", () => { schedule("afterRender", () => {
if (this._state !== "inDOM") { if (this._state !== "inDOM") {