Skip to content

A platform for community discussion. Free, open, simple.

DEV: Custom section in Sidebar should implement own willDestory hook (#17550)

Alan Guo Xiang Tanfe6ec282285b
diff --git a/app/assets/javascripts/discourse/app/components/sidebar.js b/app/assets/javascripts/discourse/app/components/sidebar.js
index 828c4b91c4a..56acf0c914c 100644
--- a/app/assets/javascripts/discourse/app/components/sidebar.js
+++ b/app/assets/javascripts/discourse/app/components/sidebar.js
@@ -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
diff --git a/app/assets/javascripts/discourse/app/lib/sidebar/base-custom-sidebar-section.js b/app/assets/javascripts/discourse/app/lib/sidebar/base-custom-sidebar-section.js
index 6de8e133ecc..7004c8f9c20 100644
--- a/app/assets/javascripts/discourse/app/lib/sidebar/base-custom-sidebar-section.js
+++ b/app/assets/javascripts/discourse/app/lib/sidebar/base-custom-sidebar-section.js
@@ -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.
*/