mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
Allow Multiple Invites to Party (#8683)
* (server) Add parties array to store invites * (server) Lint files * Update joinGroup, rejectGroupInvite, _inviteByUUID, and remove clearPartyInvitation.js * Update user schema: detailed 'invitations.parties' attributes * Code improvement and do not let invite twice * Check if the user is already invited earlier in the code * Added message to invitation page, and show all invitations * Added join party confirmation alert * Small fixes * Created test: allow inviting a user to 2 different parties * Updated tests * Update invitations.parties on more places * Small adjustments * Updates on invitations.party references * Show all invitations when user is already in a party * Fixed notifications counter * Update both 'party' and 'parties' at _handleGroupInvitation * Updated a test * Fixed small mistake at _handleGroupInvitation * More test update * Update invitation.party when removing single invite and small adjust at view
This commit is contained in:
@@ -14,7 +14,7 @@ angular.module('habitrpg')
|
||||
|
||||
if (user.purchased && user.purchased.plan && user.purchased.plan.mysteryItems && user.purchased.plan.mysteryItems.length) {
|
||||
return mysteryValue;
|
||||
} else if ((user.invitations.party && user.invitations.party.id) || (user.invitations.guilds && user.invitations.guilds.length > 0)) {
|
||||
} else if ((user.invitations.parties && user.invitations.parties.length > 0) || (user.invitations.guilds && user.invitations.guilds.length > 0)) {
|
||||
return invitationValue;
|
||||
} else if (user.flags.cardReceived) {
|
||||
return cardValue;
|
||||
@@ -76,8 +76,8 @@ angular.module('habitrpg')
|
||||
$scope.getNotificationsCount = function() {
|
||||
var count = 0;
|
||||
|
||||
if($scope.user.invitations.party && $scope.user.invitations.party.id){
|
||||
count++;
|
||||
if($scope.user.invitations.parties){
|
||||
count += $scope.user.invitations.parties.length;
|
||||
}
|
||||
|
||||
if($scope.user.purchased.plan && $scope.user.purchased.plan.mysteryItems.length){
|
||||
|
||||
Reference in New Issue
Block a user