tweak(resources): use 'custom appMessageEvent'

This commit is contained in:
Christopher committed 2021-03-15 10:53:02 +01:00
1 parent 5c9f36f754
commit 458839488e
4 files changed
+17 -95

No files matched your search

+3 -14
View File
@@ -1,13 +1,8 @@
import events from '../utils/events';
import { sendContactsEvent } from '../utils/messages';
onNet(events.CONTACTS_SEND_CONTACTS, (contacts: any) => {
SendNuiMessage(
JSON.stringify({
app: 'CONTACTS',
method: 'setContacts',
data: contacts,
}),
);
sendContactsEvent('setContacts', contacts);
});
RegisterNuiCallbackType(events.CONTACTS_ADD_CONTACT);
@@ -41,11 +36,5 @@ onNet(events.CONTACTS_DELETE_CONTACT_SUCCESS, () => {
});
onNet(events.CONTACTS_ACTION_RESULT, (alert: any) => {
SendNuiMessage(
JSON.stringify({
app: 'CONTACTS',
method: 'setAlert',
data: alert,
}),
);
sendContactsEvent('setAlert', alert);
});