Skip to content

A platform for community discussion. Free, open, simple.

FIX: don't set properties on destroyed components

Régis Hanol779efd923563
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 => {