mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 07:37:25 +01:00
fix for gems not removed after guild creation, fix #1186
This commit is contained in:
@@ -113,18 +113,14 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Groups', '$http', 'A
|
||||
$scope.newGroup = new Groups.Group({type:'guild', privacy:'private', leader: User.user._id, members: [User.user._id]});
|
||||
|
||||
$scope.create = function(group){
|
||||
if (User.user.balance < 1) {
|
||||
return $rootScope.modals.buyGems = true;
|
||||
// $('#more-gems-modal').modal('show');
|
||||
}
|
||||
if (User.user.balance < 1) return $rootScope.modals.buyGems = true;
|
||||
|
||||
if (confirm("Create Guild for 4 Gems?")) {
|
||||
group.balance = 1;
|
||||
group.$save(function(){
|
||||
User.user.balance--;
|
||||
User.log({op:'set', data:{'balance':User.user.balance}});
|
||||
window.setTimeout(function(){window.location.href='/';}, 500)
|
||||
})
|
||||
location.reload();
|
||||
}, function(error){
|
||||
alert(error.data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user