From 3cbb67c71ac91e5b33c7c6ae1ac2352c12d17cc7 Mon Sep 17 00:00:00 2001 From: Phillip Thelen Date: Mon, 29 Jul 2024 17:29:42 +0200 Subject: [PATCH] Steampunk gear should not have an end date (#15256) --- test/common/libs/shops.test.js | 10 ++++++++ website/common/script/libs/shops.js | 36 ++++++++++++++++++----------- 2 files changed, 32 insertions(+), 14 deletions(-) diff --git a/test/common/libs/shops.test.js b/test/common/libs/shops.test.js index 576d31c32d..e7d919fda9 100644 --- a/test/common/libs/shops.test.js +++ b/test/common/libs/shops.test.js @@ -341,6 +341,16 @@ describe('shops', () => { const backgrounds = shopCategories.find(cat => cat.identifier === 'backgrounds').items; expect(backgrounds.length).to.be.greaterThan(0); }); + + it('does not add an end date to steampunk gear', () => { + const categories = shopCategories.filter(cat => cat.identifier.startsWith('30')); + categories.forEach(category => { + expect(category.end).to.not.exist; + category.items.forEach(item => { + expect(item.end).to.not.exist; + }); + }); + }); }); describe('customizationShop', () => { diff --git a/website/common/script/libs/shops.js b/website/common/script/libs/shops.js index a712fe1eec..0f754eb10f 100644 --- a/website/common/script/libs/shops.js +++ b/website/common/script/libs/shops.js @@ -404,22 +404,30 @@ shops.getTimeTravelersCategories = function getTimeTravelersCategories (user, la path: `mystery.${set.key}`, pinType: 'mystery_set', purchaseAll: true, - end: Number(set.key) < 300000 ? availabilityMatchers.end : null, }; - category.items = map(set.items, item => ({ - key: item.key, - text: item.text(language), - notes: item.notes(language), - type: item.type, - purchaseType: 'gear', - value: 1, - locked: false, - currency: 'hourglasses', - class: `shop_${item.key}`, - pinKey: `timeTravelers!gear.flat.${item.key}`, - end: availabilityMatchers.end, - })); + if (!set.key.startsWith('30')) { + category.end = availabilityMatchers.end; + } + + category.items = map(set.items, item => { + const shopItem = { + key: item.key, + text: item.text(language), + notes: item.notes(language), + type: item.type, + purchaseType: 'gear', + value: 1, + locked: false, + currency: 'hourglasses', + class: `shop_${item.key}`, + pinKey: `timeTravelers!gear.flat.${item.key}`, + }; + if (!item.set.startsWith('mystery-30')) { + shopItem.end = availabilityMatchers.end; + } + return shopItem; + }); if (category.items.length > 0) { categories.push(category); }