mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-03 14:38:45 +00:00
feat(notes/client): client functionality > sending nui messages | triggering evetns
This commit is contained in:
1 parent
0f4a7e773f
commit
497fd37d53
1 file changed
+32
@@ -0,0 +1,32 @@
|
||||
import events from '../utils/events';
|
||||
|
||||
onNet(events.NOTE_SEND_NOTE, (notes: any) => {
|
||||
console.log(notes)
|
||||
SendNuiMessage(
|
||||
JSON.stringify({
|
||||
app: "NOTES",
|
||||
method: "setNotes",
|
||||
data: notes
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
RegisterNuiCallbackType(events.NOTE_ADD_NOTE);
|
||||
on(`__cfx_nui:${events.NOTE_ADD_NOTE}`, (data: any) => {
|
||||
const note = data;
|
||||
emitNet(events.NOTE_ADD_NOTE, note)
|
||||
|
||||
setTimeout(() => {
|
||||
emitNet(events.NOTE_FETCH_ALL_NOTES)
|
||||
}, 500);
|
||||
})
|
||||
|
||||
RegisterNuiCallbackType(events.NOTE_DELETE_NOTE);
|
||||
on(`__cfx_nui:${events.NOTE_DELETE_NOTE}`, (data: any) => {
|
||||
const noteId = data;
|
||||
emitNet(events.NOTE_DELETE_NOTE, noteId)
|
||||
|
||||
setTimeout(() => {
|
||||
emitNet(events.NOTE_FETCH_ALL_NOTES)
|
||||
}, 500);
|
||||
})
|
||||
Reference in new issue
Block a user