commcoach: SpeechRecognition Neustart nach botSpeaking/interrupted Wechsel
Made-with: Cursor
This commit is contained in:
parent
bc94e52904
commit
93016a7e4c
1 changed files with 8 additions and 2 deletions
|
|
@ -171,8 +171,14 @@ export const CommcoachDossierView: React.FC = () => {
|
|||
if (!SpeechRecognitionApi) return;
|
||||
|
||||
if (speechRecognitionRef.current) {
|
||||
try { speechRecognitionRef.current.start(); } catch { /* already running */ }
|
||||
return;
|
||||
try {
|
||||
speechRecognitionRef.current.start();
|
||||
_dlog('REC-RESTART', 'reused existing');
|
||||
} catch {
|
||||
_dlog('REC-RESTART', 'existing failed, recreating');
|
||||
speechRecognitionRef.current = null;
|
||||
}
|
||||
if (speechRecognitionRef.current) return;
|
||||
}
|
||||
|
||||
let cancelled = false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue