fixes #1936. petCount was only being calculated for the current user, not for the profile being displayed. This data should probably be calculated in the model rather than in a controller

This commit is contained in:
Nick Gordon
2013-11-27 21:22:15 -08:00
parent 1d03fee4e3
commit 62aeb7087a
2 changed files with 3 additions and 1 deletions

View File

@@ -65,6 +65,8 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Groups', '$http', 'A
}
// We watch Members.selectedMember because it's asynchronously set, so would be a hassle to handle updates here
$scope.$watch( function() { return Members.selectedMember; }, function (member) {
if(member)
member.petCount = window.habitrpgShared.helpers.countPets(null, member.items.pets);
$scope.profile = member;
});
}

View File

@@ -34,7 +34,7 @@ p
span(popover-trigger='mouseenter', popover='(Level-1)/2') {{userDef(profile.stats.lvl)}}
p
strong Pets Found
| : {{petCount}}
| : {{profile.petCount}}
hr
p
strong Total Experience Boost