fix(calls): check if player does not exist --no-verify

This commit is contained in:
Christopher committed 2021-05-15 05:08:51 +02:00
1 parent 951ed914d5
commit 46484be9bc
3 files changed
+22

No files matched your search

@@ -2,8 +2,21 @@ import { useSetRecoilState } from 'recoil';
import { useNuiEvent } from 'fivem-nui-react-lib';
import { dialState } from './state';
import { CallEvents } from '../../../../../typings/call';
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
import { useTranslation } from 'react-i18next';
export const useDialService = () => {
const { addAlert } = useSnackbar();
const { t } = useTranslation();
const handleAddAlert = ({ message, type }: IAlert) => {
addAlert({
message: t(`APPS_${message}`),
type,
});
};
const setHistory = useSetRecoilState(dialState.history);
useNuiEvent('DIALER', CallEvents.SET_CALL_HISTORY, setHistory);
useNuiEvent('DAILER', CallEvents.SEND_ALERT, handleAddAlert);
};