From 894321f0dc4fa884cc1b6612ac553390b08adea5 Mon Sep 17 00:00:00 2001 From: Jens Mohrmann Date: Thu, 25 Dec 2025 20:59:47 +0100 Subject: [PATCH] fix build error --- src/App.tsx | 5 ++++- src/components/SheetMusic.tsx | 5 ++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index a341cc2..1b21bac 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -139,6 +139,9 @@ function App() { } if (pitchData.midi === targetMidi) { + // Prevent re-triggering success if we're already in a success state + if (feedbackMessage === "Good!") return; + if (matchStartTime === null) { setMatchStartTime(Date.now()); } else { @@ -147,6 +150,7 @@ function App() { // Success! setFeedbackMessage("Good!"); setRevealed(true); + setMatchStartTime(null); const isRhythmActive = settings.rhythm.active && settings.rhythm.autoAdvance; const isTimerMode = settings.rhythm.mode === 'seconds'; @@ -157,7 +161,6 @@ function App() { setTimeout(() => { generateNewNote(); }, 800); - setMatchStartTime(null); } else { // Rhythm Active AND Auto-Advance if (isTimerMode) { diff --git a/src/components/SheetMusic.tsx b/src/components/SheetMusic.tsx index 30fa532..e7cca5c 100644 --- a/src/components/SheetMusic.tsx +++ b/src/components/SheetMusic.tsx @@ -127,8 +127,7 @@ export const SheetMusic: React.FC = ({ const data = getNoteInKey(visualMidi, keySignature); const ghost = new GhostNote({ keys: data.keys, - duration: "w", - clef: noteClef as 'treble' | 'bass' + duration: "w" }); // Add a Question Mark Annotation @@ -160,7 +159,7 @@ export const SheetMusic: React.FC = ({ if (clef === 'grand') noteClef = getGrandStaffClef(visualMidi); const data = getNoteInKey(visualMidi, keySignature); - const ghost = new GhostNote({ keys: data.keys, duration: "h", clef: noteClef as 'treble' | 'bass' }); + const ghost = new GhostNote({ keys: data.keys, duration: "h" }); ghost.addModifier(new Annotation("?").setVerticalJustification(Annotation.VerticalJustify.CENTER)); targetHalfObj = { note: ghost, clef: noteClef }; } else {