From b9d943220db456a234fe483a66a74d2d7abcb047 Mon Sep 17 00:00:00 2001 From: Vinoth Kannan Date: Fri, 18 Feb 2022 09:03:32 +0530 Subject: [PATCH] UX: display post count badge even when user has only two posts. (#15990) Previously, it only displayed the badge when a user has 3 or more posts. --- app/assets/javascripts/discourse/app/widgets/topic-map.js | 2 +- .../tests/integration/widgets/topic-participant-test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/app/widgets/topic-map.js b/app/assets/javascripts/discourse/app/widgets/topic-map.js index 9ecb167fc23..7f21df2aac4 100644 --- a/app/assets/javascripts/discourse/app/widgets/topic-map.js +++ b/app/assets/javascripts/discourse/app/widgets/topic-map.js @@ -75,7 +75,7 @@ createWidget("topic-participant", { }), ]; - if (attrs.post_count > 2) { + if (attrs.post_count > 1) { linkContents.push(h("span.post-count", attrs.post_count.toString())); } diff --git a/app/assets/javascripts/discourse/tests/integration/widgets/topic-participant-test.js b/app/assets/javascripts/discourse/tests/integration/widgets/topic-participant-test.js index 1c81bed4973..38ba3462e04 100644 --- a/app/assets/javascripts/discourse/tests/integration/widgets/topic-participant-test.js +++ b/app/assets/javascripts/discourse/tests/integration/widgets/topic-participant-test.js @@ -37,7 +37,7 @@ discourseModule( this.set("args", { username: "test", avatar_template: "/images/avatar.png", - post_count: 5, + post_count: 2, primary_group_name: "devs", flair_name: "devs", flair_url: "/images/d-logo-sketch-small.png",