finish add/buy in frontend
This commit is contained in:
@@ -23,11 +23,20 @@ export default {
|
||||
},
|
||||
buyItems(items) {
|
||||
AppStorage.buyItems(items)
|
||||
.then(_ => this.notifications.push(`Bought ${items.length} items`))
|
||||
.then((items) => {
|
||||
this.notifications.push(`Bought ${items.length} items`)
|
||||
this.loot = this.loot.concat(items);
|
||||
})
|
||||
},
|
||||
sellItems (items) {
|
||||
AppStorage.sellItems(items)
|
||||
.then(_ => this.notifications.push(`Sold ${items.length} items`))
|
||||
.then(_ => {
|
||||
this.notifications.push(`Sold ${items.length} items`)
|
||||
for (var idx in items) {
|
||||
var to_remove = items[idx][0];
|
||||
this.loot = this.loot.filter((item) => item.id != to_remove);
|
||||
}
|
||||
})
|
||||
},
|
||||
parseLoot (items) {
|
||||
this.loot = [];
|
||||
|
||||
Reference in New Issue
Block a user