mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-04-14 19:56:23 +00:00
added field to updates to remove rewarded gear from pinned items, if present (#14406)
This commit is contained in:
parent
7309ab4fd4
commit
cdd1bf1cf0
1 changed files with 2 additions and 0 deletions
|
|
@ -872,6 +872,7 @@ function _getUserUpdateForQuestReward (itemToAward, allAwardedItems) {
|
|||
let updates = {
|
||||
$set: {},
|
||||
$inc: {},
|
||||
$pull: {},
|
||||
};
|
||||
const dropK = itemToAward.key;
|
||||
|
||||
|
|
@ -879,6 +880,7 @@ function _getUserUpdateForQuestReward (itemToAward, allAwardedItems) {
|
|||
case 'gear': {
|
||||
// TODO This means they can lose their new gear on death, is that what we want?
|
||||
updates.$set[`items.gear.owned.${dropK}`] = true;
|
||||
updates.$pull.pinnedItems = { path: `gear.flat.${dropK}` };
|
||||
break;
|
||||
}
|
||||
case 'eggs':
|
||||
|
|
|
|||
Loading…
Reference in a new issue