Files
habitica/website/common/script/libs/isPinned.js
negue 2624b06729 [WIP] shops + market gear api (#8980)
* 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
2017-08-24 07:16:18 +02:00

10 lines
318 B
JavaScript

module.exports = function isPinned (user, item) {
if (user === null)
return false;
const isUnpinned = user.unpinnedItems.findIndex(unpinned => unpinned.path === item.path) > -1;
const pinnedItem = user.pinnedItems.findIndex(pinned => pinned.path === item.path) > -1;
return pinnedItem && !isUnpinned;
};