Skip to content

Commit

Permalink
fix(groups): update leader when memberCount is 1
Browse files Browse the repository at this point in the history
  • Loading branch information
SabreCat committed Aug 17, 2018
1 parent 354c63f commit ef830e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion website/server/controllers/api-v3/groups.js
Expand Up @@ -631,7 +631,7 @@ api.joinGroup = {
promises = await Promise.all(promises);

// @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() && group.memberCount === 1) group.leader = user._id; // If new user is only member -> set as leader

if (group.hasNotCancelled()) {
await payments.addSubToGroupUser(user, group);
Expand Down

0 comments on commit ef830e5

Please sign in to comment.