Skip to content

Commit

Permalink
Stopping web socket connection when window is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
polterguy committed Sep 27, 2023
1 parent bb02462 commit 09ca0ce
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions backend/files/system/openai/front.files/chat/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ function aista_create_chat_ui() {
if (btns.length > 0) {
btns[0].style.display = 'block';
}
if (ainiro_con) {
ainiro_con.stop();
ainiro_con = null;
}
}
});

Expand All @@ -180,6 +184,10 @@ function aista_create_chat_ui() {
if (btns.length > 0) {
btns[0].style.display = 'block';
}
if (ainiro_con) {
ainiro_con.stop();
ainiro_con = null;
}
});

// Add an event listener to the microphone button.
Expand Down

0 comments on commit 09ca0ce

Please sign in to comment.