Skip to content

Commit 72aae63

Browse files
sharpninjaCopilot
andcommitted
Fix TTS Stop button never enabled during SSE streaming
The SSE streaming code path spoke sentences inline without setting _isSpeaking=true, so UpdateButtons() never enabled the Stop button. Now sets _isSpeaking before streaming and clears it after all TTS completes. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent f8f195c commit 72aae63

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/McpServerManager.Android/Views/SimplifiedVoiceView.axaml.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,9 @@ private async Task RunConversationLoopAsync(CancellationToken ct)
243243
var sentenceBuffer = new StringBuilder();
244244
var spokenUpTo = 0;
245245
var isDone = false;
246+
_isSpeaking = true;
247+
_ttsStopped = false;
248+
UpdateButtons();
246249

247250
await foreach (var evt in vm.SubmitTurnStreamingAsync(transcript, ct).ConfigureAwait(true))
248251
{
@@ -321,6 +324,9 @@ private async Task RunConversationLoopAsync(CancellationToken ct)
321324
catch (OperationCanceledException) { /* ok */ }
322325
}
323326

327+
_isSpeaking = false;
328+
UpdateButtons();
329+
324330
ct.ThrowIfCancellationRequested();
325331
if (listenResult.ShouldEndChat)
326332
{

0 commit comments

Comments
 (0)