Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: clear pressingRef in keying listener cleanup

Adam Eivy68664b8f56b4
diff --git a/client/src/components/meatspace/post/MorseTrainer.jsx b/client/src/components/meatspace/post/MorseTrainer.jsx
index a3d6bdfaa3..43e613db1a 100644
--- a/client/src/components/meatspace/post/MorseTrainer.jsx
+++ b/client/src/components/meatspace/post/MorseTrainer.jsx
@@ -303,6 +303,11 @@ function useKeyingDecoder({ unitMs, hz, ensureCtx, enabled = false }) {
if (flushTimerRef.current) clearTimeout(flushTimerRef.current);
if (wordTimerRef.current) clearTimeout(wordTimerRef.current);
stopTone();
+ // If the user mode-switches mid-keydown, the matching keyup fires after
+ // the listener is gone — reset the press tracking so the next mode
+ // change doesn't leave beginPress permanently blocked by a stuck ref.
+ pressingRef.current = false;
+ setPressing(false);
};
}, [beginPress, endPress, stopTone, enabled]);