update conatct enums

This commit is contained in:
Christopher committed 2021-03-25 11:42:44 +01:00
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 -2
View File
@@ -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);
});
+1
View File
@@ -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',
}