From 779efd923563b852ba1d135902abd3c9a0fa3e6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Fri, 22 Dec 2017 20:33:33 +0100 Subject: [PATCH] FIX: don't set properties on destroyed components --- app/assets/javascripts/discourse/components/d-editor.js.es6 | 1 + .../discourse/components/composer-presence-display.js.es6 | 1 + 2 files changed, 2 insertions(+) diff --git a/app/assets/javascripts/discourse/components/d-editor.js.es6 b/app/assets/javascripts/discourse/components/d-editor.js.es6 index c0454cd6c82..7b255638578 100644 --- a/app/assets/javascripts/discourse/components/d-editor.js.es6 +++ b/app/assets/javascripts/discourse/components/d-editor.js.es6 @@ -279,6 +279,7 @@ export default Ember.Component.extend({ const markdownOptions = this.get('markdownOptions') || {}; cookAsync(value, markdownOptions).then(cooked => { + if (this.get('isDestroyed')) { return; } this.set('preview', cooked); Ember.run.scheduleOnce('afterRender', () => { if (this._state !== "inDOM") { return; } diff --git a/plugins/discourse-presence/assets/javascripts/discourse/components/composer-presence-display.js.es6 b/plugins/discourse-presence/assets/javascripts/discourse/components/composer-presence-display.js.es6 index 334f627bbb0..a16c2d2293a 100644 --- a/plugins/discourse-presence/assets/javascripts/discourse/components/composer-presence-display.js.es6 +++ b/plugins/discourse-presence/assets/javascripts/discourse/components/composer-presence-display.js.es6 @@ -73,6 +73,7 @@ export default Ember.Component.extend({ previous: this.get('previousState'), current: this.get('currentState') }).then(r => { + if (this.get('isDestroyed')) { return; } this.set('presenceUsers', r.users); this.set('channel', r.messagebus_channel); this.messageBus.subscribe(r.messagebus_channel, message => {