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
d036243d64
commit
be8e9bfa39
4 files changed
+5
-7
No files matched your search
+1
-1
@@ -40,7 +40,7 @@
|
|||||||
"showNotifications": true
|
"showNotifications": true
|
||||||
},
|
},
|
||||||
"debug": {
|
"debug": {
|
||||||
"level": "debug",
|
"level": "silly",
|
||||||
"enabled": true
|
"enabled": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -101,7 +101,7 @@ const ContactsInfoPage = () => {
|
|||||||
addContact(serverResp.data);
|
addContact(serverResp.data);
|
||||||
addAlert({
|
addAlert({
|
||||||
message: t('APPS_CONTACT_ADD_SUCCESS'),
|
message: t('APPS_CONTACT_ADD_SUCCESS'),
|
||||||
type: 'error',
|
type: 'success',
|
||||||
});
|
});
|
||||||
history.replace(referal);
|
history.replace(referal);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -54,8 +54,7 @@ export const useContactActions = (): UseContactsValue => {
|
|||||||
|
|
||||||
const deleteContact = useCallback(
|
const deleteContact = useCallback(
|
||||||
(id: number): void => {
|
(id: number): void => {
|
||||||
const contactIndex = contacts.findIndex((contact) => contact.id === id);
|
const newContacts = [...contacts].filter((contact) => contact.id !== id);
|
||||||
const newContacts = [...contacts].slice(contactIndex);
|
|
||||||
setContacts(newContacts);
|
setContacts(newContacts);
|
||||||
},
|
},
|
||||||
[contacts, setContacts],
|
[contacts, setContacts],
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
import PlayerService from '../players/player.service';
|
import PlayerService from '../players/player.service';
|
||||||
import { contactsLogger } from './contacts.utils';
|
import { contactsLogger } from './contacts.utils';
|
||||||
import ContactsDB, { _ContactsDB } from './contacts.db';
|
import ContactsDB, { _ContactsDB } from './contacts.db';
|
||||||
import { Contact, ContactEvents, PreDBContact } from '../../../typings/contact';
|
import { Contact, ContactDeleteDTO, PreDBContact } from '../../../typings/contact';
|
||||||
import { FxServerResponse } from '../../../typings/phone';
|
import { PromiseEventResp, PromiseRequest } from '../utils/PromiseNetEvents/promise.types';
|
||||||
import { ContactServerResp } from './contacts.interfaces';
|
|
||||||
|
|
||||||
class _ContactService {
|
class _ContactService {
|
||||||
private readonly contactsDB: _ContactsDB;
|
private readonly contactsDB: _ContactsDB;
|
||||||
|
|||||||
Reference in new issue
Block a user