mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-02 14:38:46 +00:00
update conatct enums
This commit is contained in:
1 parent
2cd3e9e93d
commit
2e4d752cd3
3 files changed
+6
-4
No files matched your search
@@ -4,6 +4,7 @@ import { contactsState } from './state';
|
||||
import { useContacts } from './useContacts';
|
||||
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { ContactEvents } from '../../../../../typings/contact';
|
||||
|
||||
export const useContactsService = () => {
|
||||
const setContacts = useSetRecoilState(contactsState.contacts);
|
||||
@@ -17,7 +18,7 @@ export const useContactsService = () => {
|
||||
});
|
||||
};
|
||||
|
||||
useNuiEvent('CONTACTS', 'setContacts', setContacts);
|
||||
useNuiEvent('CONTACTS', 'setAlert', handleAddAlert);
|
||||
useNuiEvent('CONTACTS', ContactEvents.SEND_CONTACTS, setContacts);
|
||||
useNuiEvent('CONTACTS', ContactEvents.SEND_ALERT, handleAddAlert);
|
||||
return useContacts();
|
||||
};
|
||||
@@ -2,7 +2,7 @@ import { ContactEvents } from '../../typings/contact';
|
||||
import { sendContactsEvent } from '../utils/messages';
|
||||
|
||||
onNet(ContactEvents.SEND_CONTACTS, (contacts: any) => {
|
||||
sendContactsEvent('setContacts', contacts);
|
||||
sendContactsEvent(ContactEvents.SEND_CONTACTS, contacts);
|
||||
});
|
||||
|
||||
RegisterNuiCallbackType(ContactEvents.ADD_CONTACT);
|
||||
@@ -36,5 +36,5 @@ onNet(ContactEvents.DELETE_CONTACT_SUCCESS, () => {
|
||||
});
|
||||
|
||||
onNet(ContactEvents.ACTION_RESULT, (alert: any) => {
|
||||
sendContactsEvent('setAlert', alert);
|
||||
sendContactsEvent(ContactEvents.SEND_ALERT, alert);
|
||||
});
|
||||
@@ -28,4 +28,5 @@ export enum ContactEvents {
|
||||
DELETE_CONTACT_SUCCESS = 'npwd:deleteSuccess',
|
||||
UPDATE_CONTACT_SUCCESS = 'npwd:updateContactSuccess',
|
||||
ACTION_RESULT = 'npwd:contactActionResult',
|
||||
SEND_ALERT = 'npwd:contactSetAlert',
|
||||
}
|
||||
Reference in new issue
Block a user