DEV: Custom section in Sidebar should implement own willDestory hook (#17550)
No need for us to specify our custom teardown hook when Sidebar component is destroyed when each custom section link is expected to be its own component and can implement its own `willDestory` hook.
This commit is contained in:
parent
0d72a8c458
commit
fe6ec28228
|
@ -37,7 +37,6 @@ export default class Sidebar extends GlimmerComponent {
|
|||
if (this.site.mobileView) {
|
||||
document.removeEventListener("click", this.collapseSidebar);
|
||||
}
|
||||
this.customSections.forEach((customSection) => customSection.teardown());
|
||||
}
|
||||
|
||||
@cached
|
||||
|
|
|
@ -6,11 +6,6 @@ export default class BaseCustomSidebarSection {
|
|||
this.sidebar = sidebar;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when sidebar component is torn down.
|
||||
*/
|
||||
teardown() {}
|
||||
|
||||
/**
|
||||
* @returns {string} The name of the section header. Needs to be dasherized and lowercase.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue