DEV: Prevent empty admin topic buttons from rendering

When using api.decorateWidget("topic-admin-menu:adminMenuButtons") in plugins, an empty button is added if the helper only returns attributes based on a condition (for example, if the admin action is limited to public topics.) In that case, we need to exclude the button from rendering.
This commit is contained in:
Penar Musaraj 2019-12-12 12:21:30 -05:00
parent f62c9def33
commit ff163ae980
1 changed files with 1 additions and 0 deletions

View File

@ -272,6 +272,7 @@ export default createWidget("topic-admin-menu", {
"ul",
buttons
.concat(extraButtons)
.filter(Boolean)
.map(b => this.attach("admin-menu-button", b))
)
];