mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
Feat(Contacts:client): Sending data to NUI
This commit is contained in:
1 parent
1e3b8ce6a7
commit
a28df727f1
2 files changed
+4
-5
No files matched your search
@@ -5,6 +5,6 @@ import { useContacts } from "./useContacts";
|
|||||||
|
|
||||||
export const useContactsService = () => {
|
export const useContactsService = () => {
|
||||||
const setContacts = useSetRecoilState(contactsState.contacts);
|
const setContacts = useSetRecoilState(contactsState.contacts);
|
||||||
useNuiEvent("BANK", "setContacts", setContacts);
|
useNuiEvent("CONTACTS", "setContacts", setContacts);
|
||||||
return useContacts();
|
return useContacts();
|
||||||
};
|
};
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import { ESX } from '../client/client';
|
import { ESX } from '../client/client';
|
||||||
import events from '../utils/events';
|
import events from '../utils/events';
|
||||||
|
|
||||||
onNet(events.CONTACTS_SEND_CONTACTS, () => {
|
|
||||||
ESX.TriggerServerCallback(events.CONTACTS_GET_CONTACTS, (contacts: any) => {
|
onNet(events.CONTACTS_SEND_CONTACTS, (contacts: any) => {
|
||||||
SendNuiMessage(
|
SendNuiMessage(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
app: 'CONTACTS',
|
app: 'CONTACTS',
|
||||||
@@ -10,8 +10,7 @@ onNet(events.CONTACTS_SEND_CONTACTS, () => {
|
|||||||
data: contacts
|
data: contacts
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
});
|
|
||||||
|
|
||||||
RegisterNuiCallbackType(events.CONTACTS_ADD_CONTACT_NUI);
|
RegisterNuiCallbackType(events.CONTACTS_ADD_CONTACT_NUI);
|
||||||
on(`__cfx_nui:${events.CONTACTS_ADD_CONTACT_NUI}`, (data: any) => {
|
on(`__cfx_nui:${events.CONTACTS_ADD_CONTACT_NUI}`, (data: any) => {
|
||||||
|
|||||||
Reference in new issue
Block a user