diff --git a/src/pages/Chat.jsx b/src/pages/Chat.jsx index cfbbb29..874ae49 100644 --- a/src/pages/Chat.jsx +++ b/src/pages/Chat.jsx @@ -116,7 +116,12 @@ const Chat = () => { }, []); useEffect(() => { - retrieveMessages().then(); + // retrieveMessages().then(); + const interval = setInterval(() => { + retrieveMessages().then() + }, 2000); + + return () => clearInterval(interval) }, [myId, interlocutorId]); useEffect(() => {