Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Koenig - Fixed "set on destroyed object" error
Browse files Browse the repository at this point in the history
refs TryGhost/Ghost#9623
- the `{{koenig-toolbar}} `didReceiveAttrs` hook was triggering an async action when the component was being destroyed so a guard is needed around the call to `set` in the `_hideToolbar` method
  • Loading branch information
kevinansfield committed May 28, 2018
1 parent bc309a0 commit 83d7211
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/koenig-editor/addon/components/koenig-toolbar.js
Expand Up @@ -227,7 +227,9 @@ export default Component.extend({
},

_hideToolbar() {
this.set('showToolbar', false);
if (!this.isDestroyed || !this.isDestroying) {
this.set('showToolbar', false);
}
this._lastRange = null;
this._removeMousemoveHandler();
},
Expand Down

0 comments on commit 83d7211

Please sign in to comment.