mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 21:27:23 +01:00
Fix: reassign object for user.items.hatchingPotions to trigger change in vue view
This commit is contained in:
@@ -120,8 +120,14 @@ export default function randomDrop (user, options, req = {}, analytics) {
|
||||
randomVal(pickBy(content.hatchingPotions, (v, k) => acceptableDrops.indexOf(k) >= 0)),
|
||||
);
|
||||
|
||||
user.items.hatchingPotions[drop.key] = user.items.hatchingPotions[drop.key] || 0;
|
||||
user.items.hatchingPotions[drop.key] += 1;
|
||||
user.items.hatchingPotions = {
|
||||
...user.items.hatchingPotions,
|
||||
[drop.key]: user.items.hatchingPotions[drop.key] || 0,
|
||||
};
|
||||
user.items.hatchingPotions = {
|
||||
...user.items.hatchingPotions,
|
||||
[drop.key]: drop.key + 1,
|
||||
};
|
||||
if (user.markModified) user.markModified('items.hatchingPotions');
|
||||
|
||||
drop.type = 'HatchingPotion';
|
||||
|
||||
Reference in New Issue
Block a user