Skip to content

Commit

Permalink
fix: Use willDestroy() instead of destroy(). (#211)
Browse files Browse the repository at this point in the history
Previous implementation did not call super.destroy() which means
potentially some of super class functionality
was not executed.

From lifecycle perspective willDestroy()
is better suited for teardown.
  • Loading branch information
raido authored Feb 12, 2021
1 parent 72a940f commit 38fbc19
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion addon/helpers/page-title.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ export default class PageTitle extends Helper {
return '';
}

destroy() {
willDestroy() {
super.willDestroy();
this.tokens.remove(this.tokenId);
this.tokens.scheduleTitleUpdate();
}
Expand Down

0 comments on commit 38fbc19

Please sign in to comment.