diff --git a/phone/src/apps/contacts/hooks/useContactsService.ts b/phone/src/apps/contacts/hooks/useContactsService.ts index 2753228..a959c87 100644 --- a/phone/src/apps/contacts/hooks/useContactsService.ts +++ b/phone/src/apps/contacts/hooks/useContactsService.ts @@ -5,6 +5,6 @@ import { useContacts } from "./useContacts"; export const useContactsService = () => { const setContacts = useSetRecoilState(contactsState.contacts); - useNuiEvent("BANK", "setContacts", setContacts); + useNuiEvent("CONTACTS", "setContacts", setContacts); return useContacts(); }; diff --git a/resources/client/cl_contacts.ts b/resources/client/cl_contacts.ts index bb4c40f..f1c1431 100644 --- a/resources/client/cl_contacts.ts +++ b/resources/client/cl_contacts.ts @@ -1,17 +1,16 @@ import { ESX } from '../client/client'; import events from '../utils/events'; -onNet(events.CONTACTS_SEND_CONTACTS, () => { - ESX.TriggerServerCallback(events.CONTACTS_GET_CONTACTS, (contacts: any) => { - SendNuiMessage( - JSON.stringify({ - app: 'CONTACTS', - method: 'setContacts', - data: contacts - }) - ) - }) -}); + +onNet(events.CONTACTS_SEND_CONTACTS, (contacts: any) => { + SendNuiMessage( + JSON.stringify({ + app: 'CONTACTS', + method: 'setContacts', + data: contacts + }) + ) +}) RegisterNuiCallbackType(events.CONTACTS_ADD_CONTACT_NUI); on(`__cfx_nui:${events.CONTACTS_ADD_CONTACT_NUI}`, (data: any) => {