Skip to content

Commit

Permalink
- correction de la condition
Browse files Browse the repository at this point in the history
  • Loading branch information
matthieu2607 committed Feb 10, 2019
1 parent 13797bd commit b57fe50
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
.vscode/chrome

\.idea/
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 && newPair[0] != newPair[1]) {
if (matched && newPair[0] !== newPair[1]) {
this.setState({ matchedCardIndices: [...matchedCardIndices, ...newPair] })
}
setTimeout(() => this.setState({ currentPair: [] }), VISUAL_PAUSE_MSECS)
Expand Down

0 comments on commit b57fe50

Please sign in to comment.