mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +01:00
* lock other classes gear * fix avatar in equip-gear-modal * fix seasonal shop * seasonal : new gear type order * fix pin gear (and get new gear on buying) * API: /shops/market-gear - refactoring pinnedGearUtils - move _isPinned to common/libs * use shops.getMarketGearCategories to list the marketGear * use shops.getMarketCategories instead of API-call * mark gear reward items as locked * purchase time-travelers stuff + update view + use method instead of http-api + add missing mammoth shop image * Time Travelers Shop: open/closed state * time travelers: show gear preview + hide sidebar if closed * update resized images * fix lint
24 lines
728 B
JavaScript
24 lines
728 B
JavaScript
import content from '../content/index';
|
|
import get from 'lodash/get';
|
|
import getItemInfo from './getItemInfo';
|
|
import shops from './shops';
|
|
|
|
const officialPinnedItems = content.officialPinnedItems;
|
|
|
|
module.exports = function getPinnedItems (user) {
|
|
const officialPinnedItemsNotUnpinned = officialPinnedItems.filter(officialPin => {
|
|
const isUnpinned = user.unpinnedItems.findIndex(unpinned => unpinned.path === officialPin.path) > -1;
|
|
return !isUnpinned;
|
|
});
|
|
|
|
const pinnedItems = officialPinnedItemsNotUnpinned.concat(user.pinnedItems);
|
|
|
|
let items = pinnedItems.map(({type, path}) => {
|
|
return getItemInfo(user, type, get(content, path));
|
|
});
|
|
|
|
shops.checkMarketGearLocked(user, items);
|
|
|
|
return items;
|
|
};
|