mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
Reset enough gems variable if user selects group other than habitrpg
This commit is contained in:
committed by
Blade Barringer
parent
fce622ddc7
commit
53c21b07a3
@@ -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;
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user