diff --git a/app/assets/javascripts/discourse/app/templates/badges/show.hbs b/app/assets/javascripts/discourse/app/templates/badges/show.hbs
index b8f481e212d..b64df76694c 100644
--- a/app/assets/javascripts/discourse/app/templates/badges/show.hbs
+++ b/app/assets/javascripts/discourse/app/templates/badges/show.hbs
@@ -37,10 +37,18 @@
{{#if this.canSelectTitle}}
{{/if}}
diff --git a/app/assets/javascripts/discourse/app/widgets/poster-name.js b/app/assets/javascripts/discourse/app/widgets/poster-name.js
index 0dd6336ccd9..640a6353f76 100644
--- a/app/assets/javascripts/discourse/app/widgets/poster-name.js
+++ b/app/assets/javascripts/discourse/app/widgets/poster-name.js
@@ -167,8 +167,20 @@ export default createWidget("poster-name", {
);
}
+ this.buildTitleObject(attrs, contents);
+
+ if (this.siteSettings.enable_user_status) {
+ this.addUserStatus(contents, attrs);
+ }
+
+ return contents;
+ },
+
+ buildTitleObject(attrs, contents) {
+ const primaryGroupName = attrs.primary_group_name;
const title = attrs.user_title,
titleIsGroup = attrs.title_is_group;
+
if (title && title.length) {
contents.push(
this.attach("poster-name-title", {
@@ -178,12 +190,6 @@ export default createWidget("poster-name", {
})
);
}
-
- if (this.siteSettings.enable_user_status) {
- this.addUserStatus(contents, attrs);
- }
-
- return contents;
},
addUserStatus(contents, attrs) {