Use gem calc functions

This commit is contained in:
Blade Barringer
2015-07-24 10:34:29 -05:00
parent c92678008b
commit 7c4486e001

View File

@@ -69,6 +69,9 @@ habitrpg.controller("ChallengesCtrl", ['$rootScope','$scope', 'Shared', 'User',
members: [], members: [],
official: false official: false
}); });
_calculateMaxPrize(defaultGroup);
_checkIfUserHasEnoughGemsForTavernChallenge();
}; };
/** /**
@@ -277,7 +280,14 @@ habitrpg.controller("ChallengesCtrl", ['$rootScope','$scope', 'Shared', 'User',
} }
$scope.$watch('newChallenge.group', function(gid){ $scope.$watch('newChallenge.group', function(gid){
$scope.hasEnoughGems(gid); if (!gid) return;
_checkIfUserHasEnoughGemsForTavernChallenge();
$scope.maxPrize = _calculateMaxPrize(gid);
if (gid == 'habitrpg') {
$scope.newChallenge.prize = 1;
}
}) })
$scope.selectAll = function(){ $scope.selectAll = function(){