Fix bug where non-party members could not send invitations

This commit is contained in:
Blade Barringer
2015-09-05 08:02:00 -05:00
parent 807e6eb7cf
commit f65ca3cf48

View File

@@ -15,14 +15,15 @@ habitrpg.controller('InviteToGroupCtrl', ['$scope', 'User', 'Groups', 'injectedG
};
$scope.inviteNewUsers = function(inviteMethod) {
if (!$scope.group.name) {
$scope.group.name = env.t('possessiveParty', {name: User.user.profile.name});
if (!$scope.group._id) {
$scope.group.name = $scope.group.name || env.t('possessiveParty', {name: User.user.profile.name});
return $scope.group.$save()
.then(function(res) {
_inviteByMethod(inviteMethod);
});
}
$scope.group.$save()
.then(function(res) {
_inviteByMethod(inviteMethod);
});
_inviteByMethod(inviteMethod);
};
function _inviteByMethod(inviteMethod) {