mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
Ensure correct join/leave button for parties
This commit is contained in:
@@ -23,6 +23,12 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', '
|
||||
return _.detect(Groups.myGuilds(), function(g) { return g._id === group._id });
|
||||
}
|
||||
|
||||
// Similarly, if we're dealing with the user's current party, return true.
|
||||
if(group.type === 'party') {
|
||||
var currentParty = Groups.party();
|
||||
if(currentParty._id && currentParty._id === group._id) return true;
|
||||
}
|
||||
|
||||
if (!group.members) return false;
|
||||
var memberIds = _.map(group.members, function(x){return x._id});
|
||||
return ~(memberIds.indexOf(userid));
|
||||
|
||||
Reference in New Issue
Block a user