mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-22 11:38:24 +00:00
fix for multiple guilds creation
This commit is contained in:
parent
878bfc7f46
commit
860a084c69
1 changed files with 5 additions and 2 deletions
|
|
@ -198,8 +198,10 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Groups', '$http', 'A
|
|||
}
|
||||
$scope.type = 'guild';
|
||||
$scope.text = 'Guild';
|
||||
$scope.newGroup = new Groups.Group({type:'guild', privacy:'private', leader: User.user._id, members: [User.user._id]});
|
||||
|
||||
var newGroup = function(){
|
||||
return new Groups.Group({type:'guild', privacy:'private', leader: User.user._id, members: [User.user._id]});
|
||||
}
|
||||
$scope.newGroup = newGroup()
|
||||
$scope.create = function(group){
|
||||
if (User.user.balance < 1) return $rootScope.modals.buyGems = true;
|
||||
|
||||
|
|
@ -209,6 +211,7 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Groups', '$http', 'A
|
|||
$scope.groups.guilds.push(saved);
|
||||
if(saved.privacy === 'public') $scope.groups.public.push(saved);
|
||||
$state.go('options.social.guilds.detail', {gid: saved._id});
|
||||
$scope.newGroup = newGroup();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue