From c1c24f429fc8dd8c27871c8d9c45c1a934f8b88b Mon Sep 17 00:00:00 2001
From: Yuval Adam <_@yuv.al>
Date: Mon, 10 Mar 2025 11:26:42 +0100
Subject: Remove dynamic canonical

---
 src/pages/chart/ChartPage.tsx | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

(limited to 'src/pages/chart/ChartPage.tsx')

diff --git a/src/pages/chart/ChartPage.tsx b/src/pages/chart/ChartPage.tsx
index 784aa0d..ffb679e 100644
--- a/src/pages/chart/ChartPage.tsx
+++ b/src/pages/chart/ChartPage.tsx
@@ -43,10 +43,18 @@ const ChartPage = () => {
         clickedItem.classList.add('playing');
       }
 
-      cw.play(character, {
-        wpm: 20,
-        actx: actxRef.current
-      });
+      try {
+        // Get Morse code for the character
+        const morseCode = getMorseCode(character);
+        
+        // Play the Morse code
+        window.cw.play(morseCode, {
+          wpm: 20,
+          actx: actxRef.current
+        });
+      } catch (error) {
+        console.error('Error playing Morse code:', error);
+      }
 
       // Remove the 'playing' class after the audio finishes
       setTimeout(() => {
-- 
cgit v1.3.1

