FIX: bug and typo in admin user badges

This commit is contained in:
Penar Musaraj 2018-11-26 10:24:46 -05:00
parent b0d08b5a8c
commit 2e4706b787
1 changed files with 2 additions and 2 deletions

View File

@ -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;
});