Reset enough gems variable if user selects group other than habitrpg

This commit is contained in:
TheHollidayInn
2015-04-12 18:22:38 -05:00
committed by Blade Barringer
parent fce622ddc7
commit 53c21b07a3

View File

@@ -309,7 +309,11 @@ habitrpg.controller("ChallengesCtrl", ['$rootScope','$scope', 'Shared', 'User',
$scope.maxPrize = User.user.balance*4 + ((group && group.balance && group.leader==User.user._id) ? group.balance*4 : 0);
if (gid == 'habitrpg') {
$scope.newChallenge.prize = 1;
//If the usere does not have enough gems for the Habitrpg group, the set our enoughGems var to false
if ( $scope.maxPrize <= 0 ) $scope.enoughGems = false;
} else {
//Reset our enoughGems variable incase the user tried to create a challenge for habitrpg and was unable to
$scope.enoughGems = true;
}
})