From 8a64def8935218f14b075264d39bdf874f4b3d20 Mon Sep 17 00:00:00 2001 From: Sabe Jones Date: Thu, 17 Dec 2020 09:36:49 -0600 Subject: [PATCH] fix(event): more find syntax, fix featured items, no spoilers --- website/common/script/content/gear/sets/special/index.js | 4 +--- website/common/script/content/hatching-potions.js | 9 ++++++--- website/common/script/content/shop-featuredItems.js | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/website/common/script/content/gear/sets/special/index.js b/website/common/script/content/gear/sets/special/index.js index dacbacb6b4..eb57d7c4e8 100644 --- a/website/common/script/content/gear/sets/special/index.js +++ b/website/common/script/content/gear/sets/special/index.js @@ -14,9 +14,7 @@ import * as takeThisGear from './special-takeThis'; import * as wonderconGear from './special-wondercon'; import t from '../../../translation'; -const CURRENT_EVENT = find(EVENTS, event => { - moment().isBetween(event.start, event.end); -}); +const CURRENT_EVENT = find(EVENTS, event => moment().isBetween(event.start, event.end)); const gearEvents = cloneDeep(EVENTS); ['winter', 'birthday', 'gaymerx', 'noCurrentEvent2020', 'winter2021NoPromo', 'noCurrentEvent2021'].forEach(nonGearEvent => { diff --git a/website/common/script/content/hatching-potions.js b/website/common/script/content/hatching-potions.js index 92c34f1084..a1de7771eb 100644 --- a/website/common/script/content/hatching-potions.js +++ b/website/common/script/content/hatching-potions.js @@ -410,7 +410,10 @@ const premium = { canBuy: hasQuestAchievementFunction('blackPearl'), _addlNotes: t('premiumPotionUnlimitedNotes'), }, - StainedGlass: { +}; + +if (moment().isAfter('2020-12-22T08:00-04:00')) { + premium.StainedGlass = { value: 2, text: t('hatchingPotionStainedGlass'), limited: true, @@ -421,8 +424,8 @@ const premium = { canBuy () { return moment().isBetween('2020-12-22T08:00-04:00', '2021-01-31T20:00-04:00'); }, - }, -}; + }; +} const wacky = { Veggie: { diff --git a/website/common/script/content/shop-featuredItems.js b/website/common/script/content/shop-featuredItems.js index fd233d1121..b844dd87a7 100644 --- a/website/common/script/content/shop-featuredItems.js +++ b/website/common/script/content/shop-featuredItems.js @@ -4,7 +4,7 @@ import moment from 'moment'; // path: 'premiumHatchingPotions.Rainbow', const featuredItems = { market () { - if (moment().isBefore('2020-12-17T08:00-04:00')) { + if (moment().isBefore('2020-12-22T08:00-04:00')) { return [ { type: 'armoire',