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

@@ -71,9 +71,15 @@ export default function updateStats (user, stats, req = {}, analytics) {
if (user.addNotification) user.addNotification('DROPS_ENABLED');
if (user.items.eggs.Wolf > 0) {
user.items.eggs.Wolf += 1;
user.items.eggs = {
...user.items.eggs,
Wolf: user.items.eggs.Wolf + 1,
};
} else {
user.items.eggs.Wolf = 1;
user.items.eggs = {
...user.items.eggs,
Wolf: 1,
};
}
if (user.markModified) user.markModified('items.eggs');