fix alert provider | remove alert from notes and contact

This commit is contained in:
Christopher committed 2021-02-13 13:48:05 +01:00
1 parent 9ba8bd683f
commit b4258718d8
13 files changed
+67 -175

No files matched your search

@@ -1,13 +1,16 @@
import { createContext, useCallback } from 'react';
import { useSetRecoilState } from 'recoil';
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
import { useNotes } from './useNotes';
import { noteStates } from './state';
import { useNotesAlert } from './useNoteAlert';
import { useSnackbar } from '../../../ui/hooks/useSnackbar';
export const useNotesService = () => {
const { addAlert } = useSnackbar()
const setNotes = useSetRecoilState(noteStates.noteItems);
const setAlert = useSetRecoilState(noteStates.alert);
useNuiEvent('NOTES', 'setNotes', setNotes);
useNuiEvent('NOTES', 'setAlert', setAlert)
return { useNotes, useNotesAlert };
useNuiEvent('NOTES', 'setAlert', addAlert)
return useNotes();
};