mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
Ensured leader doesn't change with group plans (#10480)
This commit is contained in:
committed by
Matteo Pagliazzi
parent
6659d4fa52
commit
cbcf5a03e1
@@ -588,7 +588,8 @@ api.joinGroup = {
|
||||
}
|
||||
if (!isUserInvited) throw new NotAuthorized(res.t('messageGroupRequiresInvite'));
|
||||
|
||||
if (group.memberCount === 0) group.leader = user._id; // If new user is only member -> set as leader
|
||||
// @TODO: Review the need for this and if still needed, don't base this on memberCount
|
||||
if (!group.hasNotCancelled() && group.memberCount === 0) group.leader = user._id; // If new user is only member -> set as leader
|
||||
|
||||
if (group.hasNotCancelled()) {
|
||||
await payments.addSubToGroupUser(user, group);
|
||||
|
||||
Reference in New Issue
Block a user