I think I found a bug on the way the deck is updated in the state when taking an action.
There are 5 filters on game.js that update the deck like this:
deck = deck.filter(x => [cardLeft, cardRight].indexOf(x) === -1)
This removes all occurrences of cardLeft and cardRight and I think they are not needed because the cards are already removed when splicing the deck to get the hand or dealer cards. I think this is a bug when playing with more than one deck.
To fix that for this particular filter (the second one in game.js) I updated the deck like this:
const { deck } = this.state
And removed the line with the filter.
The rest can be a bit different depending on where the state deck is, but I think all 5 filters need to be removed.
I saw on #63 that you are planning on transcribing the project to typescript. Can you check that too while you are at it?
I think I found a bug on the way the deck is updated in the state when taking an action.
There are 5 filters on game.js that update the deck like this:
deck = deck.filter(x => [cardLeft, cardRight].indexOf(x) === -1)This removes all occurrences of cardLeft and cardRight and I think they are not needed because the cards are already removed when splicing the deck to get the hand or dealer cards. I think this is a bug when playing with more than one deck.
To fix that for this particular filter (the second one in game.js) I updated the deck like this:
const { deck } = this.stateAnd removed the line with the filter.
The rest can be a bit different depending on where the state deck is, but I think all 5 filters need to be removed.
I saw on #63 that you are planning on transcribing the project to typescript. Can you check that too while you are at it?