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:
Alan Guo Xiang Tan 2022-07-18 12:57:14 +08:00 committed by GitHub
parent 0d72a8c458
commit fe6ec28228
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 6 deletions

View File

@ -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

View File

@ -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.
*/