Ensure first-time purchases are synced (#11915)

* Ensure first-time purchases are synced

* whitespace commit to trigger tests

* Undo whitespace commit

* more whitespace

* remove the whitespace
This commit is contained in:
Alec Brickner
2020-03-02 12:34:23 -08:00
committed by GitHub
parent 6a9025200c
commit 966bcf8010

View File

@@ -64,7 +64,10 @@ function purchaseItem (user, item, price, type, key) {
if (!user.items[type][key] || user.items[type][key] < 0) {
user.items[type][key] = 0;
}
user.items[type][key] += 1;
user.items[type] = {
...user.items[type],
[key]: user.items[type][key] + 1,
};
if (user.markModified) user.markModified(`items.${type}`);
}
}