mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +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);
|
emitNet(events.NOTE_FETCH_ALL_NOTES);
|
||||||
});
|
});
|
||||||
|
|
||||||
// coming soon tm
|
|
||||||
RegisterNuiCallbackType(events.NOTE_UPDATE_NOTE);
|
RegisterNuiCallbackType(events.NOTE_UPDATE_NOTE);
|
||||||
on(`__cfx_nui:${events.NOTE_UPDATE_NOTE}`, (data: any) => {
|
on(`__cfx_nui:${events.NOTE_UPDATE_NOTE}`, (data: any) => {
|
||||||
const note = data;
|
const note = data;
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ onNet(events.NOTE_ADD_NOTE, async (note: Note) => {
|
|||||||
try {
|
try {
|
||||||
const _identifier = await useIdentifier();
|
const _identifier = await useIdentifier();
|
||||||
addNote(_identifier, note);
|
addNote(_identifier, note);
|
||||||
|
emitNet(events.NOTE_SEND_NOTE_SUCCESS, getSource());
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("NOTES ERROR: ", error);
|
console.log("NOTES ERROR: ", error);
|
||||||
}
|
}
|
||||||
@@ -44,7 +45,6 @@ onNet(events.NOTE_FETCH_ALL_NOTES, async () => {
|
|||||||
const _identifier = await useIdentifier();
|
const _identifier = await useIdentifier();
|
||||||
const notes = await fetchAllNotes(_identifier);
|
const notes = await fetchAllNotes(_identifier);
|
||||||
emitNet(events.NOTE_SEND_NOTE, _source, notes);
|
emitNet(events.NOTE_SEND_NOTE, _source, notes);
|
||||||
emitNet(events.NOTE_SEND_NOTE_SUCCESS, _source);
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log("NOTE ERROR: ", error);
|
console.log("NOTE ERROR: ", error);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user