fixed group not insta displaying after creation

This commit is contained in:
slawk0
2024-12-14 19:35:49 +01:00
parent f268c0c7f7
commit 3efd536db6

View File

@@ -52,17 +52,13 @@ function ContactsList({
return () => {
socket?.off('added to group');
};
}, [contactsList.length]);
}, []);
const fetchContacts = async () => {
const contacts: ContactsProps[] = await getContactsList();
console.log('Fetching contacts list');
setContactsList((prevContacts) => {
const newContacts = contacts.filter(
(contact) => !prevContacts.some((c) => c.user_id === contact.user_id),
);
return [...prevContacts, ...newContacts];
});
console.log('Fetching contacts list', contacts);
setContactsList(contacts);
};
async function removeContact(contactId: number, conversation_id: number) {