mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 14:17:22 +01:00
sep 25 fixes (#9075)
* on class change: remove owned gear from pinned items * move dragging item-info closer to the cursor (food / hatching potion) * remove v-once at attributesPopover (if the parent component is recycled the old data stays active) * prevent popover to show data of an item that was removed - but the popover stays opened
This commit is contained in:
@@ -104,6 +104,18 @@ function removePinnedGearAddPossibleNewOnes (user, itemPath, newItemKey) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* removes all pinned gear that the user already owns (like class starter gear which has been pinned before)
|
||||
* @param user
|
||||
*/
|
||||
function removePinnedItemsByOwnedGear (user) {
|
||||
each(user.items.gear.owned, (bool, key) => {
|
||||
if (bool) {
|
||||
removeItemByPath(user, `gear.flat.${key}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @returns {boolean} TRUE added the item / FALSE removed it
|
||||
*/
|
||||
@@ -150,6 +162,7 @@ module.exports = {
|
||||
addPinnedGear,
|
||||
removePinnedGearByClass,
|
||||
removePinnedGearAddPossibleNewOnes,
|
||||
removePinnedItemsByOwnedGear,
|
||||
togglePinnedItem,
|
||||
removeItemByPath,
|
||||
isPinned,
|
||||
|
||||
Reference in New Issue
Block a user