mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 12:02:13 +00:00
Corrected how count is calculated
This commit is contained in:
parent
f6885427a8
commit
a72ae097d6
1 changed files with 2 additions and 2 deletions
|
|
@ -88,8 +88,8 @@ habitrpg.controller("RootCtrl", ['$scope', '$rootScope', '$location', 'User', '$
|
|||
// count pets, mounts collected totals, etc
|
||||
$rootScope.countExists = function(items) {return _.reduce(items,function(m,v){return m+(v?1:0)},0)}
|
||||
|
||||
$rootScope.petCount = Shared.countPets(null, User.user.items.pets);
|
||||
$rootScope.mountCount = Shared.countMounts(null, User.user.items.mounts);
|
||||
$rootScope.petCount = Shared.countPets($rootScope.countExists(User.user.items.pets), User.user.items.pets);
|
||||
$rootScope.mountCount = Shared.countMounts($rootScope.countExists(User.user.items.mounts), User.user.items.mounts);
|
||||
|
||||
$rootScope.$watch('user.items.pets', function(pets){
|
||||
$rootScope.petCount = Shared.countPets($rootScope.countExists(pets), User.user.items.pets);
|
||||
|
|
|
|||
Loading…
Reference in a new issue