diff --git a/src/js/audio.js b/src/js/audio.js index f1c3805f..5812067b 100644 --- a/src/js/audio.js +++ b/src/js/audio.js @@ -38,6 +38,11 @@ class Audio { * Triggers playOscillator() with the correct parameters. */ playTone(params = null) { + // workaround for FF starting audio context in a suspended state + if (this.audioContext.state === 'suspended') { + this.audioContext.resume(); + } + let currentDuration = constants.duration; let volume = constants.vol; if (params != null) { diff --git a/src/js/constants.js b/src/js/constants.js index 518aec05..cb6867fe 100644 --- a/src/js/constants.js +++ b/src/js/constants.js @@ -2271,8 +2271,7 @@ class ChatLLM { if (data.text()) { text = data.text(); chatLLM.DisplayChatMessage(LLMName, text); - } - if (data.error) { + } else if (data.error) { chatLLM.DisplayChatMessage(LLMName, 'Error processing request.', true); chatLLM.WaitingSound(false); } @@ -2281,7 +2280,7 @@ class ChatLLM { // if we're tracking, log the data if (constants.canTrack) { let chatHist = chatLLM.CopyChatHistory(); - tracker.SetData('ChatHistory', chatHist); + tracker.SetData('ChatHistory', { chatHistory: chatHist }); } }