mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
Revert "Fix: Antidotes to Avatar Transformation Items should be added to Rewards by API (#11353)" (#11406)
This reverts commit 5b57d91a9b.
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
import getDebuffPotionItems from './getDebuffPotionItems';
|
||||
|
||||
|
||||
module.exports = function setDebuffPotionItems (user) {
|
||||
const debuffPotionItems = getDebuffPotionItems(user);
|
||||
|
||||
if (debuffPotionItems.length) {
|
||||
let isPresent = false;
|
||||
const isUserHaveDebuffInPinnedItems = user.pinnedItems.find(pinnedItem => {
|
||||
debuffPotionItems.forEach(debuffPotion => {
|
||||
if (!isPresent) {
|
||||
isPresent = debuffPotion.path === pinnedItem.path;
|
||||
}
|
||||
});
|
||||
return isPresent;
|
||||
});
|
||||
|
||||
if (!isUserHaveDebuffInPinnedItems) {
|
||||
user.pinnedItems.push(...debuffPotionItems);
|
||||
}
|
||||
} else {
|
||||
user.pinnedItems = user.pinnedItems.filter(item => {
|
||||
return item.type !== 'debuffPotion';
|
||||
});
|
||||
}
|
||||
|
||||
return user;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user