small fixes
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user