From 882d1b6ee572c381b6ddbe46e6425b097580435f Mon Sep 17 00:00:00 2001 From: Dev Date: Wed, 14 Feb 2024 11:58:17 +0000 Subject: [PATCH] FIx equipment preset flea seach not showing any offers --- project/src/controllers/RagfairController.ts | 5 +++-- project/src/helpers/RagfairOfferHelper.ts | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/project/src/controllers/RagfairController.ts b/project/src/controllers/RagfairController.ts index 50f899c7..a7939aa8 100644 --- a/project/src/controllers/RagfairController.ts +++ b/project/src/controllers/RagfairController.ts @@ -86,6 +86,8 @@ export class RagfairController public getOffers(sessionID: string, searchRequest: ISearchRequestData): IGetOffersResult { + const pmcProfile = this.profileHelper.getPmcProfile(sessionID); + const itemsToAdd = this.ragfairHelper.filterCategories(sessionID, searchRequest); const traderAssorts = this.ragfairHelper.getDisplayableAssorts(sessionID); const result: IGetOffersResult = { @@ -94,10 +96,9 @@ export class RagfairController selectedCategory: searchRequest.handbookId, }; - const pmcProfile = this.profileHelper.getPmcProfile(sessionID); - result.offers = this.getOffersForSearchType(searchRequest, itemsToAdd, traderAssorts, pmcProfile); + // Client requested a category refresh if (searchRequest.updateOfferCount) { result.categories = this.getSpecificCategories(pmcProfile, searchRequest, result.offers); diff --git a/project/src/helpers/RagfairOfferHelper.ts b/project/src/helpers/RagfairOfferHelper.ts index 64738c20..8843dd39 100644 --- a/project/src/helpers/RagfairOfferHelper.ts +++ b/project/src/helpers/RagfairOfferHelper.ts @@ -702,7 +702,11 @@ export class RagfairOfferHelper } // weapon/equipment search + offer is preset - if (searchRequest.buildCount && this.presetHelper.hasPreset(offerRootItem._tpl)) + if ( + Object.keys(searchRequest.buildItems).length === 0 // Prevent equipment loadout searches filtering out presets + && searchRequest.buildCount + && this.presetHelper.hasPreset(offerRootItem._tpl) + ) { return false; }