FIX: bug and typo in admin user badges

FIX: bug and typo in admin user badges

From 2e4706b7871066df1240b4e36197170a6345b687 Mon Sep 17 00:00:00 2001
From: Penar Musaraj <pmusaraj@gmail.com>
Date: Mon, 26 Nov 2018 10:24:46 -0500
Subject: [PATCH] FIX: bug and typo in admin user badges


diff --git a/app/assets/javascripts/admin/controllers/admin-user-badges.js.es6 b/app/assets/javascripts/admin/controllers/admin-user-badges.js.es6
index 784d207..c71c83c 100644
--- a/app/assets/javascripts/admin/controllers/admin-user-badges.js.es6
+++ b/app/assets/javascripts/admin/controllers/admin-user-badges.js.es6
@@ -15,12 +15,12 @@ export default Ember.Controller.extend(GrantBadgeController, {
     var grouped = _.groupBy(allBadges, badge => badge.badge_id);
 
     var expanded = [];
-    const expandedBadges = allBadges.get("expandedBadges");
+    const expandedBadges = allBadges.get("expandedBadges") || [];
 
     _(grouped).each(function(badges) {
       var lastGranted = badges[0].granted_at;
 
-      badges.forEaach(badge => {
+      badges.forEach(badge => {
         lastGranted =
           lastGranted < badge.granted_at ? badge.granted_at : lastGranted;
       });

GitHub

1 Like

Thx for this, I broke the “e” of my keyboard… and thought I had double check because of this, but I do plenty of spelling mistakes because of this…

Should get the replacement soon

3 Likes