Skip to content

Unneeded filters on game.js #64

@jmolero

Description

@jmolero

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions