updates frontend to use DB api

This commit is contained in:
2019-07-04 14:53:50 +02:00
parent 4e28eb4159
commit 503ebf7b6b
5 changed files with 103 additions and 61 deletions

View File

@@ -82,8 +82,7 @@
},
computed: {
player () {
const id = this.state.player_id;
const idx = this.state.player_list.findIndex(p => p.id == id);
const idx = this.state.player_id;
return this.state.player_list[idx];
},
wealth () {
@@ -104,10 +103,9 @@
}
},
setActivePlayer (playerIdx) {
const newId = this.state.player_list[playerIdx].id;
AppStorage.setActivePlayer(newId);
if (newId == 0) { this.hidePlayerChest() }
this.player.name = this.state.player_list[playerIdx].name
var playerIdx = Number(playerIdx);
AppStorage.setActivePlayer(playerIdx);
if (playerIdx == 0) { this.hidePlayerChest() }
},
closeDropdown () {
this.show_dropdown = false