Skip to content

Commit

Permalink
refactor: Use new destruction method when destroying stray modals
Browse files Browse the repository at this point in the history
  • Loading branch information
pichfl committed Oct 14, 2022
1 parent 2482656 commit 6d7d586
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions addon/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ export default class Modal {
}
}

_destroy() {
if (this._componentInstance) {
this._componentInstance.destroyModal();
}
}

then(onFulfilled, onRejected) {
return this._deferred.promise.then(onFulfilled, onRejected);
}
Expand Down
2 changes: 1 addition & 1 deletion addon/services/modals.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default Service.extend({

_destroyModals() {
this._stack.forEach(modal => {
modal._remove();
modal._destroy();
});
},

Expand Down

0 comments on commit 6d7d586

Please sign in to comment.