Fix issue with l4p not resetting properly (#15240)

* actually clear out seeking field on user. Even when creating a party

* Add tests to ensure party.seeking is cleared

* fix(lint): don't assign unused const

---------

Co-authored-by: Sabe Jones <sabe@habitica.com>
This commit is contained in:
Phillip Thelen
2024-06-11 00:00:31 +02:00
committed by GitHub
parent 37f08c4534
commit 758b6138c2
3 changed files with 23 additions and 1 deletions

View File

@@ -136,6 +136,7 @@ api.createGroup = {
if (user.party._id) throw new NotAuthorized(res.t('messageGroupAlreadyInParty'));
user.party._id = group._id;
user.party.seeking = undefined;
}
let savedGroup;
@@ -590,7 +591,7 @@ api.joinGroup = {
// Clear all invitations of new user and reset looking for party state
user.invitations.parties = [];
user.invitations.party = {};
user.party.seeking = null;
user.party.seeking = undefined;
// invite new user to pending quest
if (group.quest.key && !group.quest.active) {