From b0d2625958aa1717f86d572687e1f71eb18bdc90 Mon Sep 17 00:00:00 2001
From: Yuval Adam <_@yuv.al>
Date: Fri, 7 Mar 2025 13:55:33 +0100
Subject: Remove unused reset game

---
 src/components/MorseGame.tsx | 36 +-----------------------------------
 1 file changed, 1 insertion(+), 35 deletions(-)

(limited to 'src/components/MorseGame.tsx')

diff --git a/src/components/MorseGame.tsx b/src/components/MorseGame.tsx
index daa0a7d..5009044 100644
--- a/src/components/MorseGame.tsx
+++ b/src/components/MorseGame.tsx
@@ -14,7 +14,7 @@ interface MorseGameProps {
   onReset?: () => void;
 }
 
-const MorseGame: React.FC<MorseGameProps> = ({ onReset }) => {
+const MorseGame: React.FC<MorseGameProps> = () => {
   // Game variables
   const [score, setScore] = useState(0);
   const [totalPlayed, setTotalPlayed] = useState(0);
@@ -23,8 +23,6 @@ const MorseGame: React.FC<MorseGameProps> = ({ onReset }) => {
   const [wpm, setWpm] = useState(20);
   const [showHints, setShowHints] = useState(false);
   const [selectedOption, setSelectedOption] = useState<string | null>(null);
-  const [_correctAnswers, setCorrectAnswers] = useState<string[]>([]);
-  const [_incorrectAnswers, setIncorrectAnswers] = useState<string[]>([]);
 
   const actxRef = useRef<any>(null);
   const optionButtonsRef = useRef<Array<HTMLButtonElement | null>>([null, null, null, null]);
@@ -202,38 +200,6 @@ const MorseGame: React.FC<MorseGameProps> = ({ onReset }) => {
     return morseMap[char] || '';
   };
 
-  // Reset game to initial state
-  const resetGame = () => {
-    setScore(0);
-    setTotalPlayed(0);
-    setCurrentChar('');
-    setOptions([]);
-    setCorrectAnswers([]);
-    setIncorrectAnswers([]);
-
-    // Clear score tracker
-    const scoreTracker = document.getElementById('scoreTracker');
-    if (scoreTracker) {
-      scoreTracker.innerHTML = '';
-    }
-
-    // Stop any playing audio
-    if (actxRef.current) {
-      try {
-        actxRef.current.close();
-        actxRef.current = null;
-        isInitializedRef.current = false;
-      } catch (error) {
-        console.error('Error closing audio context:', error);
-      }
-    }
-
-    // Call the parent's reset function if provided
-    if (onReset) {
-      onReset();
-    }
-  };
-
   // Handle option button click
   const handleOptionClick = (option: string, index: number) => {
     const button = optionButtonsRef.current[index];
-- 
cgit v1.3.1

