Minor improvements to the assigned-to-filter connector

Minor improvements to the assigned-to-filter connector

diff --git a/assets/javascripts/discourse-assign/connectors/above-review-filters/assigned-to-filter.js.es6 b/assets/javascripts/discourse-assign/connectors/above-review-filters/assigned-to-filter.js.es6
index a7a82a0..120fbb2 100644
--- a/assets/javascripts/discourse-assign/connectors/above-review-filters/assigned-to-filter.js.es6
+++ b/assets/javascripts/discourse-assign/connectors/above-review-filters/assigned-to-filter.js.es6
@@ -4,10 +4,12 @@ export default {
   },
 
   setupComponent(args, component) {
-    const groupIDs = component.siteSettings.assign_allowed_on_groups.split("|");
+    const groupIDs = component.siteSettings.assign_allowed_on_groups
+      .split("|")
+      .filter(Boolean);
     const groupNames = this.site.groups
       .filter(group => groupIDs.includes(group.id.toString()))
-      .map(group => group.name);
+      .mapBy("name");
     component.set("allowedGroups", groupNames);
   }
 };

GitHub sha: c4f878a7

2 Likes