diff --git a/public/js/controllers/groupsCtrl.js b/public/js/controllers/groupsCtrl.js index fe30af9239..da6f964683 100644 --- a/public/js/controllers/groupsCtrl.js +++ b/public/js/controllers/groupsCtrl.js @@ -116,7 +116,8 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', ' // 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 = Shared.countPets(null, member.items.pets); + member.petCount = Shared.countPets($rootScope.countExists(member.items.pets), member.items.pets); + member.mountCount = Shared.countMounts($rootScope.countExists(member.items.mounts), member.items.mounts); $scope.profile = member; }); $scope.sendPrivateMessage = function(uuid, message){ diff --git a/public/js/controllers/userCtrl.js b/public/js/controllers/userCtrl.js index 517d108605..cf5336f4c7 100644 --- a/public/js/controllers/userCtrl.js +++ b/public/js/controllers/userCtrl.js @@ -3,8 +3,8 @@ habitrpg.controller("UserCtrl", ['$rootScope', '$scope', '$location', 'User', '$http', '$state', 'Guide', 'Shared', function($rootScope, $scope, $location, User, $http, $state, Guide, Shared) { $scope.profile = User.user; - $scope.profile.petCount = Shared.countPets(null, $scope.profile.items.pets); - $scope.profile.mountCount = Shared.countMounts(null, $scope.profile.items.mounts); + $scope.profile.petCount = Shared.countPets($rootScope.countExists($scope.profile.items.pets), $scope.profile.items.pets); + $scope.profile.mountCount = Shared.countMounts($rootScope.countExists($scope.profile.items.mounts), $scope.profile.items.mounts); $scope.hideUserAvatar = function() { $(".userAvatar").hide(); };