mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-15 07:04:48 +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) => {
|
||||
stopPolling();
|
||||
stopSse();
|
||||
stopTurnStream();
|
||||
setSessionId(session.sessionId);
|
||||
setAgentId(session.agent);
|
||||
|
|
@ -328,6 +330,8 @@ export default function App() {
|
|||
};
|
||||
|
||||
const createNewSession = async (nextAgentId?: string) => {
|
||||
stopPolling();
|
||||
stopSse();
|
||||
stopTurnStream();
|
||||
const selectedAgent = nextAgentId ?? agentId;
|
||||
if (nextAgentId) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue