small fixes while reviewing code
This commit is contained in:
@@ -2,25 +2,22 @@
|
||||
<div class="buttons is-right" >
|
||||
<template v-if="isInConflict">
|
||||
<button class="button is-success"
|
||||
@click="cancelRequest"
|
||||
>
|
||||
<span class="icon is-small">
|
||||
<i class="fas fa-hand-peace"></i>
|
||||
</span>
|
||||
</button>
|
||||
<button class="button is-danger"
|
||||
@click="hardenRequest"
|
||||
>
|
||||
<span class="icon is-small">
|
||||
<i class="fas fa-hand-middle-finger"></i>
|
||||
</span>
|
||||
</button>
|
||||
@click="cancelRequest">
|
||||
<span class="icon is-small">
|
||||
<i class="fas fa-hand-peace"></i>
|
||||
</span>
|
||||
</button>
|
||||
<button class="button is-danger"
|
||||
@click="hardenRequest">
|
||||
<span class="icon is-small">
|
||||
<i class="fas fa-hand-middle-finger"></i>
|
||||
</span>
|
||||
</button>
|
||||
</template>
|
||||
<button class="button is-primary"
|
||||
@click="putRequest"
|
||||
:class="{'is-outlined': isRequested}"
|
||||
:disabled="isRequested"
|
||||
>
|
||||
@click="putRequest"
|
||||
:class="{'is-small': isRequested}"
|
||||
:disabled="isRequested">
|
||||
<span class="icon is-small">
|
||||
<i class="fas fa-praying-hands"></i>
|
||||
</span>
|
||||
@@ -33,20 +30,18 @@
|
||||
export default {
|
||||
props: ["item"],
|
||||
data () {
|
||||
return {
|
||||
state: AppStorage.state,
|
||||
};
|
||||
return AppStorage.state;
|
||||
},
|
||||
computed: {
|
||||
// Check if item is requested by active player
|
||||
isRequested () {
|
||||
const reqs = this.state.player_claims[this.state.player_id];
|
||||
const reqs = this.player_claims[this.player_id];
|
||||
return reqs.includes(this.item);
|
||||
},
|
||||
// Check if item is requested by multiple players including active one
|
||||
isInConflict () {
|
||||
const reqs = this.state.player_claims;
|
||||
const playerId = this.state.player_id;
|
||||
const reqs = this.player_claims;
|
||||
const playerId = this.player_id;
|
||||
var reqByPlayer = false;
|
||||
var reqByOther = false;
|
||||
for (var key in reqs) {
|
||||
|
||||
Reference in New Issue
Block a user