mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-05-19 12:18:51 +00:00
Ensured leader doesn't change with group plans (#10480)
This commit is contained in:
parent
6659d4fa52
commit
cbcf5a03e1
1 changed files with 2 additions and 1 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue