diff --git a/src/App.js b/src/App.js
index 4aea48a..f914e81 100644
--- a/src/App.js
+++ b/src/App.js
@@ -40,18 +40,23 @@ function App() {
- {keyType === "straight" ?
- : }
{gameMode === 'practice' &&
<>
+ {keyType === "straight" ?
+ : }
>
}
{/* {gameMode === 'timed' && } */}
- {gameMode === 'challenge' && }
-
+ {gameMode === 'challenge' &&
+ <>
+ {keyType === "straight" ?
+ : }
+ }
+ >
+ }
diff --git a/src/components/ChallengeBufferDisplay.js b/src/components/ChallengeBufferDisplay.js
index 76f3cbd..bd852e8 100644
--- a/src/components/ChallengeBufferDisplay.js
+++ b/src/components/ChallengeBufferDisplay.js
@@ -28,17 +28,25 @@ function ChallengeBufferDisplay(props) {
let ditDahs = []
let alphanumeric = ''
let incorrectIndex = props.incorrectIndex
+
for (let i in morseLetters) {
let morseChar = morseLetters[i]
alphanumeric += morseCode[morseChar]
let cn = ''
- cn = (incorrectIndex === i) ? 'morseError' : ''
- ditDahs.push(morseChar)
- ditDahs.push(' ')
+ console.log('incorrectIndex', incorrectIndex);
+ console.log('i', i);
+
+ cn = (incorrectIndex === Number(i)) ? 'morseError' : ''
+ ditDahs.push({morseChar})
+ ditDahs.push( )
+ }
+ if (incorrectIndex) {
+ setTimeout(() => {
+ setMorseCharBuffer(prev => prev.slice(0,-1))
+ }, 3000)
}
-
return (