refactor: precondition for record toggle
This commit is contained in:
@@ -501,8 +501,9 @@ export function ComposeOverlay({
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
// Only stop on release if held long enough (hold-to-record mode).
|
// Only stop on release if held long enough (hold-to-record mode).
|
||||||
// Quick taps are handled by the second keydown (toggle 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();
|
stopRecording();
|
||||||
|
recordStartRef.current = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user