fix abort

pull/869/head
Alex 3 months ago
parent 8d36f8850e
commit 7ef97cfd81

@ -36,7 +36,7 @@ def delete_conversation():
@user.route("/api/get_conversations", methods=["get"])
def get_conversations():
# provides a list of conversations
conversations = conversations_collection.find().sort("date", -1)
conversations = conversations_collection.find().sort("date", -1).limit(30)
list_conversations = []
for conversation in conversations:
list_conversations.append({"id": str(conversation["_id"]), "name": conversation["name"]})

@ -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) => {

Loading…
Cancel
Save