Skip to content

Commit

Permalink
Fix update tracker to correctly save chat history (#608)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellvix authored Dec 2, 2024
1 parent f26bda5 commit 9316df5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/js/audio.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
5 changes: 2 additions & 3 deletions src/js/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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 });
}
}

Expand Down

0 comments on commit 9316df5

Please sign in to comment.