Fix: reassign object for user.items.eggs to trigger change in vue view

This commit is contained in:
Xaz16
2019-12-15 20:22:47 +03:00
parent 3e476c4f52
commit aea02d735e
4 changed files with 128 additions and 32 deletions

View File

@@ -44,7 +44,10 @@ export default function hatch (user, req = {}) {
...user.items.pets,
[pet]: 5,
};
user.items.eggs[egg] -= 1;
user.items.eggs = {
...user.items.eggs,
[egg]: user.items.eggs - 1,
};
user.items.hatchingPotions[hatchingPotion] -= 1;
if (user.markModified) {
user.markModified('items.pets');