mirror of
https://github.com/discourse/discourse.git
synced 2025-01-19 02:12:46 +08:00
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:
parent
f62c9def33
commit
ff163ae980
|
@ -272,6 +272,7 @@ export default createWidget("topic-admin-menu", {
|
||||||
"ul",
|
"ul",
|
||||||
buttons
|
buttons
|
||||||
.concat(extraButtons)
|
.concat(extraButtons)
|
||||||
|
.filter(Boolean)
|
||||||
.map(b => this.attach("admin-menu-button", b))
|
.map(b => this.attach("admin-menu-button", b))
|
||||||
)
|
)
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user