Skip to content

Commit

Permalink
FIX: Error when composer open doesn't return promise (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
markvanlan committed Aug 20, 2020
1 parent e181d34 commit 74e8e61
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions assets/javascripts/initializers/shared-edits-init.js.es6
Expand Up @@ -138,11 +138,14 @@ function initWithApi(api) {

api.modifyClass("controller:composer", {
open(opts) {
return this._super(opts).then(() => {
if (opts.action === SHARED_EDIT_ACTION) {
setupSharedEdit(this.model);
}
});
const openResponse = this._super(opts);
if (openResponse && openResponse.then) {
return openResponse.then(() => {
if (opts.action === SHARED_EDIT_ACTION) {
setupSharedEdit(this.model);
}
});
}
},

collapse() {
Expand Down

0 comments on commit 74e8e61

Please sign in to comment.