From 13797bda0aed955995ec872894086758e26e9dae Mon Sep 17 00:00:00 2001 From: Matthieu BARBE Date: Sun, 10 Feb 2019 16:30:38 +0100 Subject: [PATCH] - correction bug si on fait un double clic sur une carte --- src/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.js b/src/App.js index 052247a..a0cb6e9 100644 --- a/src/App.js +++ b/src/App.js @@ -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)