FIX: pass custom section willDestroy (#17551)

Custom sections `willDestroy` function has to be passed to SidebarSection component  to call when component is removed.
This commit is contained in:
Krzysztof Kotlarek 2022-07-18 15:46:49 +10:00 committed by GitHub
parent fe6ec28228
commit 7230b0d436
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -16,6 +16,12 @@ export default class SidebarSection extends GlimmerComponent {
: false;
}
willDestroy() {
if (this.args.willDestroy) {
this.args.willDestroy();
}
}
@action
toggleSectionDisplay() {
this.displaySection = !this.displaySection;

View File

@ -18,7 +18,8 @@
@headerLinkText={{customSection.text}}
@headerLinkTitle={{customSection.title}}
@headerActionsIcon={{customSection.actionsIcon}}
@headerActions={{customSection.actions}}>
@headerActions={{customSection.actions}}
@willDestroy={{customSection.willDestroy}}>
{{#each customSection.links as |link|}}
<Sidebar::SectionLink