From 657c8a013ab6ca4d1743b7457520e6dba3c8f080 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Fri, 22 Jun 2018 10:16:43 +0800 Subject: [PATCH] UX: Don't display an empty participants section. --- .../javascripts/discourse/widgets/topic-map.js.es6 | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/discourse/widgets/topic-map.js.es6 b/app/assets/javascripts/discourse/widgets/topic-map.js.es6 index f568e435cc..d938f0c58f 100644 --- a/app/assets/javascripts/discourse/widgets/topic-map.js.es6 +++ b/app/assets/javascripts/discourse/widgets/topic-map.js.es6 @@ -222,10 +222,14 @@ createWidget("topic-map-expanded", { }, html(attrs, state) { - const avatars = h("section.avatars.clearfix", [ - h("h3", I18n.t("topic_map.participants_title")), - renderParticipants.call(this, attrs.userFilters, attrs.participants) - ]); + let avatars; + + if (attrs.participants && attrs.participants.length > 0) { + avatars = h("section.avatars.clearfix", [ + h("h3", I18n.t("topic_map.participants_title")), + renderParticipants.call(this, attrs.userFilters, attrs.participants) + ]); + } const result = [avatars]; if (attrs.topicLinks) {