Fix TTS queue bug for streamed messages
- Fixed querySelector to find Play button specifically, not first button
- Regular messages used Array.from().find() correctly
- Streaming messages were using querySelector('button') which found Delete button
- This explains why streamed messages never got added to TTS queue
This commit is contained in:
parent
853fac95a4
commit
5d78911d5b
1 changed files with 3 additions and 3 deletions
|
|
@ -822,9 +822,9 @@ socket.on("message_chunk", (data) => {
|
|||
messageId: data.id
|
||||
});
|
||||
if (autoPlayTTS && data.is_complete && messageBuffers[data.id] && messageBuffers[data.id].trim() !== "") {
|
||||
const playButton = buttonContainer.querySelector("button");
|
||||
console.log("DEBUG: Found play button for streaming TTS:", playButton ? "YES" : "NO");
|
||||
if (playButton && playButton.textContent === "Play") {
|
||||
const playButton = Array.from(buttonContainer.querySelectorAll("button")).find(btn => btn.textContent === "Play");
|
||||
console.log("DEBUG: Found play button for streaming TTS:", playButton ? "YES" : "NO", playButton?.textContent);
|
||||
if (playButton) {
|
||||
setTimeout(() => {
|
||||
const fullText = targetMessageElement.textContent || targetMessageElement.innerText;
|
||||
console.log("DEBUG: Queueing streaming TTS:", data.id, fullText.substring(0, 50) + "...");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue