mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
Use gem calc functions
This commit is contained in:
@@ -69,6 +69,9 @@ habitrpg.controller("ChallengesCtrl", ['$rootScope','$scope', 'Shared', 'User',
|
||||
members: [],
|
||||
official: false
|
||||
});
|
||||
|
||||
_calculateMaxPrize(defaultGroup);
|
||||
_checkIfUserHasEnoughGemsForTavernChallenge();
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -277,7 +280,14 @@ habitrpg.controller("ChallengesCtrl", ['$rootScope','$scope', 'Shared', 'User',
|
||||
}
|
||||
|
||||
$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(){
|
||||
|
||||
Reference in New Issue
Block a user