refactor: precondition for record toggle

This commit is contained in:
Arjun Patel
2026-04-29 06:11:57 -07:00
parent 0f73d685c2
commit 70087cf4e5
+2 -1
View File
@@ -501,8 +501,9 @@ export function ComposeOverlay({
e.preventDefault();
// Only stop on release if held long enough (hold-to-record mode).
// Quick taps are handled by the second keydown (toggle mode).
if (Date.now() - recordStartRef.current >= HOLD_THRESHOLD_MS) {
if (recordStartRef.current > 0 && Date.now() - recordStartRef.current >= HOLD_THRESHOLD_MS) {
stopRecording();
recordStartRef.current = 0;
}
}
};