Skip to content

Ace Click Error #34

@patrick-rush

Description

@patrick-rush

In the Solitaire game: when clicking an ace that is in the lake, if there are no open spaces in the lake for the ace to move to, an error is thrown due to the following code in handleUpdateLake:

        if (cardToMove) {
            copyOfLake[destination].push(cardToMove)
            if (source === CardSource.River && sourceArray.length) sourceArray[sourceArray.length - 1].flipped = true
        }

Update is needed to prevent error.

Expected behavior:

Ace in lake, when clicked, should first move to another open space in the lake (working). If no open space available, Ace should be placed on a compatible card in the River (not working). Otherwise no action should be taken.

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