fix premature closing of websocket
This commit is contained in:
parent
df07cf413b
commit
3c56b7a2b7
1 changed files with 4 additions and 1 deletions
|
|
@ -78,10 +78,13 @@ export default function ChatMessage({
|
|||
console.error(error);
|
||||
});
|
||||
}
|
||||
}, [streamUrl,chatMessage]);
|
||||
|
||||
useEffect(()=>{
|
||||
return () => {
|
||||
eventSource.current?.close();
|
||||
}
|
||||
}, [streamUrl,chatMessage]);
|
||||
},[])
|
||||
|
||||
useEffect(() => {
|
||||
const element = document.getElementById("last-chat-message");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue