small fixes

This commit is contained in:
2019-06-15 14:05:14 +02:00
parent 89547c52e5
commit 50b00cb626
3 changed files with 34 additions and 22 deletions

View File

@@ -3,7 +3,7 @@
<section id="content" class="columns is-desktop">
<Player></Player>
<div class="column">
<GroupChest></GroupChest>
<GroupChest></GroupChest>
</div>
</section>
</main>
@@ -32,7 +32,6 @@ export const store = {
if (this.debug) console.log('setActivePlayer to ', newPlayerId)
this.state.player_id = newPlayerId
document.cookie = `player_id=${newPlayerId};`;
if (this.debug) console.log('setCookie', document.cookie);
},
switchPlayerChestVisibility () {
if (this.debug) console.log('switchPlayerChestVisibility', !this.state.show_player_chest)
@@ -43,6 +42,16 @@ export const store = {
if (this.debug) console.log('newRequest from', playerId, 'on', itemId)
this.state.requests[playerId].push(itemId);
},
cancelRequest(itemId) {
const playerId = this.state.player_id
if (this.debug) console.log('cancelRequest of', playerId, 'on', itemId)
var idx = this.state.requests[playerId].indexOf(itemId);
if (idx > -1) {
this.state.requests[playerId].splice(idx, 1);
} else {
if (this.debug) console.log("cancel a non-existent request")
}
}
}
function getCookie(cname) {