From 13797bda0aed955995ec872894086758e26e9dae Mon Sep 17 00:00:00 2001 From: Matthieu BARBE Date: Sun, 10 Feb 2019 16:30:38 +0100 Subject: [PATCH 1/3] - 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) From b57fe500912ff30fe6c7c77eb681038237fbfa9e Mon Sep 17 00:00:00 2001 From: Matthieu BARBE Date: Sun, 10 Feb 2019 16:43:01 +0100 Subject: [PATCH 2/3] - correction de la condition --- .gitignore | 2 ++ src/App.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 0a6ff6e..bfee9a1 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,5 @@ npm-debug.log* yarn-debug.log* yarn-error.log* .vscode/chrome + +\.idea/ diff --git a/src/App.js b/src/App.js index a0cb6e9..bae9777 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 && newPair[0] != newPair[1]) { + if (matched && newPair[0] !== newPair[1]) { this.setState({ matchedCardIndices: [...matchedCardIndices, ...newPair] }) } setTimeout(() => this.setState({ currentPair: [] }), VISUAL_PAUSE_MSECS) From f92e4266f7e3dece081352c6407cf1db8320a599 Mon Sep 17 00:00:00 2001 From: Matthieu BARBE Date: Sun, 10 Feb 2019 16:48:39 +0100 Subject: [PATCH 3/3] - correction gitignore --- .gitignore | 2 -- 1 file changed, 2 deletions(-) mode change 100644 => 100755 .gitignore diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 index bfee9a1..0a6ff6e --- a/.gitignore +++ b/.gitignore @@ -20,5 +20,3 @@ npm-debug.log* yarn-debug.log* yarn-error.log* .vscode/chrome - -\.idea/