fix abort

This commit is contained in:
Alex
2024-03-01 15:42:22 +00:00
parent 8d36f8850e
commit 7ef97cfd81
2 changed files with 5 additions and 3 deletions

View File

@@ -41,9 +41,11 @@ export default function Conversation() {
useEffect(() => {
return () => {
fetchStream.current && fetchStream.current.abort(); //abort previous stream
if (status !== 'idle') {
fetchStream.current && fetchStream.current.abort(); //abort previous stream
}
}
}, [conversationId])
}, [status])
useEffect(() => {
const observerCallback: IntersectionObserverCallback = (entries) => {
entries.forEach((entry) => {