mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 14:17:22 +01:00
* list special gear by the `specialClass` - fixes #9485 * only disable the currencly label + value not the amount input - fixes #9492 * disable transformations on equipment previews - fixes #9497 * show boss strength - fixes #9522 * pin time travelers animals - closes #9382 * clean up + package-lock ? * fix quest info
27 lines
839 B
JavaScript
27 lines
839 B
JavaScript
import getItemInfo from './getItemInfo';
|
|
import shops from './shops';
|
|
import getOfficialPinnedItems from './getOfficialPinnedItems';
|
|
|
|
import getItemByPathAndType from './getItemByPathAndType';
|
|
|
|
module.exports = function getPinnedItems (user) {
|
|
let officialPinnedItems = getOfficialPinnedItems(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}) => {
|
|
let item = getItemByPathAndType(type, path);
|
|
|
|
return getItemInfo(user, type, item, officialPinnedItems);
|
|
});
|
|
|
|
shops.checkMarketGearLocked(user, items);
|
|
|
|
return items;
|
|
};
|