From c3e87b5036e39bca40289c4777db06cd3e949ddf Mon Sep 17 00:00:00 2001 From: David Taylor Date: Tue, 3 Dec 2024 13:12:44 +0000 Subject: [PATCH] UX: Only add `user-badge-buttons` wrapper when badges exist (#30060) Followup to 2513339955ebdfa457a5d6126716091110045e37 --- app/assets/javascripts/discourse/app/widgets/poster-name.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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.