Skip to content

Commit

Permalink
fix for multiple guilds creation
Browse files Browse the repository at this point in the history
  • Loading branch information
paglias committed Nov 26, 2013
1 parent 878bfc7 commit 860a084
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions public/js/controllers/groupsCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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();
});
}
}
Expand Down

0 comments on commit 860a084

Please sign in to comment.