mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-03 14:38:45 +00:00
fix(notes/fetch): resolve how notes was spamming evnents
This commit is contained in:
1 parent
70f2de0e14
commit
d9c71203ac
2 files changed
+1
-2
No files matched your search
@@ -28,7 +28,6 @@ on(`__cfx_nui:${events.NOTE_DELETE_NOTE}`, (data: any) => {
|
||||
emitNet(events.NOTE_FETCH_ALL_NOTES);
|
||||
});
|
||||
|
||||
// coming soon tm
|
||||
RegisterNuiCallbackType(events.NOTE_UPDATE_NOTE);
|
||||
on(`__cfx_nui:${events.NOTE_UPDATE_NOTE}`, (data: any) => {
|
||||
const note = data;
|
||||
|
||||
@@ -33,6 +33,7 @@ onNet(events.NOTE_ADD_NOTE, async (note: Note) => {
|
||||
try {
|
||||
const _identifier = await useIdentifier();
|
||||
addNote(_identifier, note);
|
||||
emitNet(events.NOTE_SEND_NOTE_SUCCESS, getSource());
|
||||
} catch (error) {
|
||||
console.log("NOTES ERROR: ", error);
|
||||
}
|
||||
@@ -44,7 +45,6 @@ onNet(events.NOTE_FETCH_ALL_NOTES, async () => {
|
||||
const _identifier = await useIdentifier();
|
||||
const notes = await fetchAllNotes(_identifier);
|
||||
emitNet(events.NOTE_SEND_NOTE, _source, notes);
|
||||
emitNet(events.NOTE_SEND_NOTE_SUCCESS, _source);
|
||||
} catch (error) {
|
||||
console.log("NOTE ERROR: ", error);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user