diff --git a/website/client/src/components/header/userDropdown.vue b/website/client/src/components/header/userDropdown.vue index 46dba369d3..f149222731 100644 --- a/website/client/src/components/header/userDropdown.vue +++ b/website/client/src/components/header/userDropdown.vue @@ -35,13 +35,9 @@ /> {{ $t('editAvatar') }} - {{ $t('backgrounds') }} { if (!cachedScheduleMatchers[matcher.type]) { cachedScheduleMatchers[matcher.type] = makeMatcherClass(); } + let end = moment(checkedDate); + end.date(TYPE_SCHEDULE[type]); + if (end.date() <= moment(checkedDate).date()) { + end = moment(end).add(1, 'months'); + } cachedScheduleMatchers[matcher.type].end = end.toDate(); if (matcher.matcher instanceof Function) { cachedScheduleMatchers[matcher.type].matchers.push(matcher.matcher); @@ -862,6 +869,7 @@ export function getScheduleMatchingGroup (type, date) { }); } if (!cachedScheduleMatchers[type]) { + // No matchers exist for this type return { items: [], match () { diff --git a/website/common/script/libs/getItemInfo.js b/website/common/script/libs/getItemInfo.js index c9074cd1a6..4e75823eef 100644 --- a/website/common/script/libs/getItemInfo.js +++ b/website/common/script/libs/getItemInfo.js @@ -8,6 +8,8 @@ import isPinned from './isPinned'; import isFreeRebirth from './isFreeRebirth'; import getOfficialPinnedItems from './getOfficialPinnedItems'; +import { ALWAYS_AVAILABLE_CUSTOMIZATIONS } from '../content/constants/schedule'; + function lockQuest (quest, user) { // checks series quests, including Masterclasser if (quest.prereqQuests) { @@ -490,8 +492,8 @@ export default function getItemInfo (user, type, item, officialPinnedItems, lang throw new BadRequest(i18n.t('wrongItemType', { type }, language)); } - if (matcher) { - itemInfo.end = { matcher }; + if (matcher && (!itemInfo.set || ALWAYS_AVAILABLE_CUSTOMIZATIONS.indexOf(itemInfo.set.key) === -1)) { + itemInfo.end = matcher.end; } return itemInfo; diff --git a/website/common/script/libs/shops.js b/website/common/script/libs/shops.js index d7d659c382..a1be27efba 100644 --- a/website/common/script/libs/shops.js +++ b/website/common/script/libs/shops.js @@ -582,6 +582,7 @@ shops.getCustomizationsShopCategories = function getCustomizationsShopCategories bg, officialPinnedItems, language, + matchers, ); backgroundCategory.items.push(item); } @@ -617,6 +618,7 @@ shops.getCustomizationsShopCategories = function getCustomizationsShopCategories hairStyle, officialPinnedItems, language, + hairType === 'color' ? customizationMatcher : null, ); category.items.push(item); } @@ -642,6 +644,7 @@ shops.getCustomizationsShopCategories = function getCustomizationsShopCategories appearance, officialPinnedItems, language, + type === 'skin' ? customizationMatcher : null, ); category.items.push(item); }