mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
Simplify group detection logic for guilds
This commit is contained in:
@@ -20,9 +20,7 @@ habitrpg.controller("GroupsCtrl", ['$scope', '$rootScope', 'Shared', 'Groups', '
|
|||||||
// If the group is a guild, just check for an intersection with the
|
// If the group is a guild, just check for an intersection with the
|
||||||
// current user's guilds, rather than checking the members of the group.
|
// current user's guilds, rather than checking the members of the group.
|
||||||
if(group.type === 'guild') {
|
if(group.type === 'guild') {
|
||||||
if (_.detect(Groups.myGuilds(), function(g) { return g._id === group._id })) {
|
return _.detect(Groups.myGuilds(), function(g) { return g._id === group._id });
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!group.members) return false;
|
if (!group.members) return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user