mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-20 04:02:43 +00:00
fix: stop SSE/polling streams when switching sessions
This commit is contained in:
parent
6bfc47f234
commit
7950c93f06
1 changed files with 4 additions and 0 deletions
|
|
@ -314,6 +314,8 @@ export default function App() {
|
||||||
};
|
};
|
||||||
|
|
||||||
const selectSession = (session: SessionInfo) => {
|
const selectSession = (session: SessionInfo) => {
|
||||||
|
stopPolling();
|
||||||
|
stopSse();
|
||||||
stopTurnStream();
|
stopTurnStream();
|
||||||
setSessionId(session.sessionId);
|
setSessionId(session.sessionId);
|
||||||
setAgentId(session.agent);
|
setAgentId(session.agent);
|
||||||
|
|
@ -328,6 +330,8 @@ export default function App() {
|
||||||
};
|
};
|
||||||
|
|
||||||
const createNewSession = async (nextAgentId?: string) => {
|
const createNewSession = async (nextAgentId?: string) => {
|
||||||
|
stopPolling();
|
||||||
|
stopSse();
|
||||||
stopTurnStream();
|
stopTurnStream();
|
||||||
const selectedAgent = nextAgentId ?? agentId;
|
const selectedAgent = nextAgentId ?? agentId;
|
||||||
if (nextAgentId) {
|
if (nextAgentId) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue