fix(notes/fetch): resolve how notes was spamming evnents

This commit is contained in:
chip committed 2020-11-06 13:37:06 +01:00
1 parent 70f2de0e14
commit d9c71203ac
2 files changed
+1 -2

No files matched your search

-1
View File
@@ -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;
+1 -1
View File
@@ -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);
}