Provide group name if not provided and save

This commit is contained in:
Blade Barringer
2015-08-22 08:40:16 -05:00
parent 1f86babad3
commit 1ff597e944
2 changed files with 32 additions and 2 deletions

View File

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