Skip to content

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

UX: Don't display participants count if it is zero.

Guo Xiang Tan4c6a0a40461e
diff --git a/app/assets/javascripts/discourse/widgets/topic-map.js.es6 b/app/assets/javascripts/discourse/widgets/topic-map.js.es6
index 88da22a63ad..f568e435cce 100644
--- a/app/assets/javascripts/discourse/widgets/topic-map.js.es6
+++ b/app/assets/javascripts/discourse/widgets/topic-map.js.es6
@@ -125,12 +125,15 @@ createWidget("topic-map-summary", {
h("h4", I18n.t("views_lowercase", { count: attrs.topicViews }))
])
);
- contents.push(
- h("li.secondary", [
- numberNode(attrs.participantCount),
- h("h4", I18n.t("users_lowercase", { count: attrs.participantCount }))
- ])
- );
+
+ if (attrs.participantCount > 0) {
+ contents.push(
+ h("li.secondary", [
+ numberNode(attrs.participantCount),
+ h("h4", I18n.t("users_lowercase", { count: attrs.participantCount }))
+ ])
+ );
+ }
if (attrs.topicLikeCount) {
contents.push(