I have added intervals for messages

This commit is contained in:
Nikolai Petukhov 2024-10-11 13:39:15 +03:00
parent 49a8af611f
commit 8fecf7cb1f

View File

@ -116,7 +116,12 @@ const Chat = () => {
}, []);
useEffect(() => {
retrieveMessages().then();
// retrieveMessages().then();
const interval = setInterval(() => {
retrieveMessages().then()
}, 2000);
return () => clearInterval(interval)
}, [myId, interlocutorId]);
useEffect(() => {