From 4c6a0a40461e3ae09c18b4d7b92da6e2f076297d Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Fri, 22 Jun 2018 08:32:20 +0800 Subject: [PATCH] UX: Don't display participants count if it is zero. This can happen for megatopics where we don't send down the payload for participants count. --- .../discourse/widgets/topic-map.js.es6 | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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(