mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-02 22:17:39 +00:00
* chore(scripts/twitter): Refactored twitter to use event enums * chore(scripts/marketplace): Refactored marketplace to use event enums * chore(scripts/messages): Refactored messages to use event enums * chore(scripts/contacts): Refactored contacts to use event enums * chore(scripts/calls): Refactored calls to use event enums * chore(scripts/notes): Refactored notes to use event enums * chore(scripts/photos): Refactored photos to use event enums * chore(scripts/bank): Refactored bank to use event enums * chore(scripts/phone): Refactored phone to use event enums * chore(events): Removed old events object * refactor(phone/nui-events): Attached NUI events to respective enum * tweak(event-enums): Added npwd prefix to all events * tweak(phone/serve): Added craco to override CRA without eject Also bumped react-scripts to 4.0.1, with seemingly no issues * fix(typings/twitter): Fixed method enums for twitter
40 lines
1.0 KiB
TypeScript
40 lines
1.0 KiB
TypeScript
import { NotesEvents } from '../../typings/notes';
|
|
import { sendNotesEvent } from '../utils/messages';
|
|
|
|
onNet(NotesEvents.SEND_NOTE, (notes: any) => {
|
|
sendNotesEvent('setNotes', notes);
|
|
});
|
|
|
|
RegisterNuiCallbackType(NotesEvents.ADD_NOTE);
|
|
on(`__cfx_nui:${NotesEvents.ADD_NOTE}`, (data: any) => {
|
|
emitNet(NotesEvents.ADD_NOTE, data);
|
|
});
|
|
|
|
onNet(NotesEvents.SEND_NOTE_SUCCESS, () => {
|
|
emitNet(NotesEvents.FETCH_ALL_NOTES);
|
|
});
|
|
|
|
onNet(NotesEvents.DELETE_NOTE_SUCCESS, () => {
|
|
emitNet(NotesEvents.FETCH_ALL_NOTES);
|
|
});
|
|
|
|
RegisterNuiCallbackType(NotesEvents.DELETE_NOTE);
|
|
on(`__cfx_nui:${NotesEvents.DELETE_NOTE}`, (data: any) => {
|
|
emitNet(NotesEvents.DELETE_NOTE, data);
|
|
|
|
emitNet(NotesEvents.FETCH_ALL_NOTES);
|
|
});
|
|
|
|
RegisterNuiCallbackType(NotesEvents.UPDATE_NOTE);
|
|
on(`__cfx_nui:${NotesEvents.UPDATE_NOTE}`, (data: any) => {
|
|
emitNet(NotesEvents.UPDATE_NOTE, data);
|
|
});
|
|
|
|
onNet(NotesEvents.UPDATE_NOTE_SUCCESS, () => {
|
|
emitNet(NotesEvents.FETCH_ALL_NOTES);
|
|
});
|
|
|
|
onNet(NotesEvents.ACTION_RESULT, (alert: any) => {
|
|
sendNotesEvent('setAlert', alert);
|
|
});
|