Show an inline speech retry control
Build and publish frontend / publish (push) Successful in 42s

This commit is contained in:
Ein Anderssono
2026-10-15 23:58:34 +02:00
parent 7d447940b3
commit 1c8d429f81
5 changed files with 48 additions and 3 deletions
+8
View File
@@ -255,6 +255,14 @@
speechStartTimer = win.setTimeout(() => {
if (token !== generation || currentUtterance !== utterance) return;
speechStartTimer = null;
generation += 1;
currentUtterance = null;
if (speechTimer !== null) win.clearTimeout(speechTimer);
speechTimer = null;
// Drop a blocked native utterance now. A player retry can then call
// speak() directly from its button gesture instead of following a
// same-turn cancel() that older WebKit versions may discard.
try { win.speechSynthesis.cancel(); } catch (_) { /* Best effort. */ }
setState('IDLE', 'Uppläsningen startade inte. Tryck på Läs senaste repliken för att starta ljudet.');
}, 4000);
speechTimer = win.setTimeout(() => {