fix issue with seasonal quest scheduling

This commit is contained in:
Phillip Thelen
2024-02-15 18:33:40 +01:00
committed by Sabe Jones
parent fe2c02679e
commit 3540a274b3
2 changed files with 28 additions and 3 deletions

View File

@@ -672,6 +672,13 @@ export const GALA_SCHEDULE = {
'shinySeed', 'shinySeed',
], ],
}, },
{
type: 'seasonalQuests',
items: [
'egg',
'waffle',
],
},
{ {
type: 'customizations', type: 'customizations',
matcher: customizationMatcher([ matcher: customizationMatcher([
@@ -695,6 +702,11 @@ export const GALA_SCHEDULE = {
'seafoam', 'seafoam',
], ],
}, },
{
type: 'seasonalQuests',
items: [
],
},
{ {
type: 'customizations', type: 'customizations',
matcher: customizationMatcher([ matcher: customizationMatcher([
@@ -717,6 +729,11 @@ export const GALA_SCHEDULE = {
'spookySparkles', 'spookySparkles',
], ],
}, },
{
type: 'seasonalQuests',
items: [
],
},
{ {
type: 'customizations', type: 'customizations',
matcher: customizationMatcher([ matcher: customizationMatcher([
@@ -799,10 +816,17 @@ export function getScheduleMatchingGroup (type, date) {
matchers: [], matchers: [],
items: [], items: [],
match (key) { match (key) {
if (this.matchers.length === 0) {
if (this.items.length > 0) {
return inListMatcher(this.items)(key);
}
} else {
if (this.items.length > 0 && !inListMatcher(this.items)(key)) { if (this.items.length > 0 && !inListMatcher(this.items)(key)) {
return false; return false;
} }
return this.matchers.every(m => m(key)); return this.matchers.every(m => m(key));
}
return false;
}, },
}; };
} }

View File

@@ -495,6 +495,7 @@ shops.getSeasonalShopCategories = function getSeasonalShopCategories (user, lang
categories.push(category); categories.push(category);
} }
console.log(questMatcher);
const quests = pickBy(content.quests, (quest, key) => questMatcher.match(key)); const quests = pickBy(content.quests, (quest, key) => questMatcher.match(key));
if (keys(quests).length > 0) { if (keys(quests).length > 0) {