Skip to content

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

UX: Don't display an empty participants section.

Guo Xiang Tan657c8a013ab6
diff --git a/app/assets/javascripts/discourse/widgets/topic-map.js.es6 b/app/assets/javascripts/discourse/widgets/topic-map.js.es6
index f568e435cce..d938f0c58fe 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) {