FIX: don't set properties on destroyed components

This commit is contained in:
Régis Hanol 2017-12-22 20:33:33 +01:00
parent ea9c1e5cf8
commit 779efd9235
2 changed files with 2 additions and 0 deletions

View File

@ -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; }

View File

@ -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 => {