mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
tweak(contacts): Misc changes to contact handling
This commit is contained in:
1 parent
ecb71cc359
commit
52ac061a3c
4 files changed
+5
-7
No files matched your search
@@ -101,7 +101,7 @@ const ContactsInfoPage = () => {
|
||||
addContact(serverResp.data);
|
||||
addAlert({
|
||||
message: t('APPS_CONTACT_ADD_SUCCESS'),
|
||||
type: 'error',
|
||||
type: 'success',
|
||||
});
|
||||
history.replace(referal);
|
||||
});
|
||||
|
||||
@@ -54,8 +54,7 @@ export const useContactActions = (): UseContactsValue => {
|
||||
|
||||
const deleteContact = useCallback(
|
||||
(id: number): void => {
|
||||
const contactIndex = contacts.findIndex((contact) => contact.id === id);
|
||||
const newContacts = [...contacts].slice(contactIndex);
|
||||
const newContacts = [...contacts].filter((contact) => contact.id !== id);
|
||||
setContacts(newContacts);
|
||||
},
|
||||
[contacts, setContacts],
|
||||
|
||||
Reference in new issue
Block a user