Skip to content

Commit

Permalink
Use cardsInHand for total cards
Browse files Browse the repository at this point in the history
  • Loading branch information
tigerclaw-az committed Oct 11, 2020
1 parent c57f973 commit c5671e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions client/src/components/Player/Player.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
></PlayerCards>
<transition-group v-else tag="div" class="cards-group hand" name="cards">
<Card
v-for="n in player.totalCards"
v-for="n in player.cardsInHand.length"
:key="n"
:card-style="cardStyle(n)"
card-type="hand"
Expand Down Expand Up @@ -103,7 +103,7 @@ export default {
},
methods: {
cardStyle(index) {
const cardsCount = this.player.totalCards;
const cardsCount = this.player.cardsInHand.length;
const styles = {
'z-index': index + 1,
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Player/PlayerCards.vue
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export default {
}
if (this.isMyTurn) {
if (card.cardType === 'special' && this.player.totalCards > 1) {
if (card.cardType === 'special' && this.player.cardsInHand.length > 1) {
this.$toasted.error(
'You cannot discard this card unless it is your ONLY card.',
);
Expand Down

0 comments on commit c5671e5

Please sign in to comment.