Skip to content

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

UX: Only add `user-badge-buttons` wrapper when badges exist (#30060)

David Taylorc3e87b5036e3
diff --git a/app/assets/javascripts/discourse/app/widgets/poster-name.js b/app/assets/javascripts/discourse/app/widgets/poster-name.js
index b1a35456974..1d93907a666 100644
--- a/app/assets/javascripts/discourse/app/widgets/poster-name.js
+++ b/app/assets/javascripts/discourse/app/widgets/poster-name.js
@@ -141,7 +141,7 @@ export default createWidget("poster-name", {
}
}
- if (attrs.badgesGranted) {
+ if (attrs.badgesGranted?.length) {
const badges = [];
attrs.badgesGranted.forEach((badge) => {
// Alter the badge description to show that the badge was granted for this post.