mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Merge branch 'sabrecat/cshop' into subs-private
This commit is contained in:
@@ -35,13 +35,9 @@
|
||||
/>
|
||||
</a>
|
||||
<a
|
||||
class="topbar-dropdown-item dropdown-item"
|
||||
class="topbar-dropdown-item dropdown-item dropdown-separated"
|
||||
@click="showAvatar('body', 'size')"
|
||||
>{{ $t('editAvatar') }}</a>
|
||||
<a
|
||||
class="topbar-dropdown-item dropdown-item dropdown-separated"
|
||||
@click="showAvatar('backgrounds', '2024')"
|
||||
>{{ $t('backgrounds') }}</a>
|
||||
<a
|
||||
class="topbar-dropdown-item dropdown-item"
|
||||
@click="showProfile('profile')"
|
||||
|
||||
@@ -132,7 +132,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
getKeyProp (item) {
|
||||
return this.keyProp ? item[this.keyProp] : item;
|
||||
return this.keyProp ? item[this.keyProp] : item.key;
|
||||
},
|
||||
isDisabled (item) {
|
||||
return typeof item[this.disabledProp] === 'undefined' ? false : item[this.disabledProp];
|
||||
|
||||
@@ -24,7 +24,7 @@ function inListMatcher (list) {
|
||||
};
|
||||
}
|
||||
|
||||
const ALWAYS_AVAILABLE_CUSTOMIZATIONS = [
|
||||
export const ALWAYS_AVAILABLE_CUSTOMIZATIONS = [
|
||||
'animalSkins',
|
||||
'rainbowSkins',
|
||||
'rainbowHairColors',
|
||||
@@ -843,16 +843,23 @@ export function getScheduleMatchingGroup (type, date) {
|
||||
const checkedDate = date || new Date();
|
||||
if (cacheDate !== null && (getDay(checkedDate) !== getDay(cacheDate)
|
||||
|| getMonth(checkedDate) !== getMonth(cacheDate))) {
|
||||
// Clear cached matchers, since they are old
|
||||
cacheDate = null;
|
||||
cachedScheduleMatchers = null;
|
||||
}
|
||||
if (!cachedScheduleMatchers) {
|
||||
// No matchers exist, make new ones
|
||||
cacheDate = new Date();
|
||||
cachedScheduleMatchers = {};
|
||||
assembleScheduledMatchers(checkedDate).forEach(matcher => {
|
||||
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 () {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user