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:
Matteo Pagliazzi
2019-10-07 16:55:44 +02:00
committed by GitHub
parent 5b57d91a9b
commit 50cae0165c
14 changed files with 35 additions and 214 deletions

View File

@@ -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;
};