Add feature to join new party if user is in a party of one

This commit is contained in:
Blade Barringer
2015-08-22 12:19:37 -05:00
parent 8c66714e5f
commit 93f02363e5
6 changed files with 61 additions and 3 deletions

View File

@@ -88,8 +88,15 @@ habitrpg.controller("PartyCtrl", ['$rootScope','$scope','Groups','Chat','User','
}
};
$scope.leaveOldPartyAndJoinNewParty = function(newPartyId, newPartyName) {
if (confirm('Are you sure you want to delete your party and join ' + newPartyName + '?')) {
Groups.Group.leave({gid: Groups.party()._id, keep:false}, undefined, function() {
$scope.join({ id: newPartyId, name: newPartyName });
});
}
}
$scope.reject = function(){
//User.user.invitations.party = undefined;
User.set({'invitations.party':{}});
}