Skip to content

Commit

Permalink
- correction bug si on fait un double clic sur une carte
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieu2607 committed Feb 10, 2019
1 parent 3359972 commit 13797bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class App extends Component {
const newGuesses = guesses + 1
const matched = cards[newPair[0]] === cards[newPair[1]]
this.setState({ currentPair: newPair, guesses: newGuesses })
if (matched) {
if (matched && newPair[0] != newPair[1]) {
this.setState({ matchedCardIndices: [...matchedCardIndices, ...newPair] })
}
setTimeout(() => this.setState({ currentPair: [] }), VISUAL_PAUSE_MSECS)
Expand Down

0 comments on commit 13797bd

Please sign in to comment.