fixed group not insta displaying after creation
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user