Fix: Workaround for ESX errors pertaining to player loading (#153)

* Set phone ready before sending any init events + Show initializing phone message if not ready yet

* Send phone ready to nui
This commit is contained in:
J Francisco Rader authored and GitHub committed 2021-03-06 19:25:32 -05:00
1 parent 6e72e2c50e
commit 1a09fa57ae
7 files changed
+76 -31

No files matched your search

@@ -4,8 +4,7 @@ import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
import { useTranslation } from 'react-i18next';
import { useMessageNotifications } from './useMessageNotifications';
import { useCallback, useEffect } from 'react';
import Nui from '../../../os/nui-events/utils/Nui';
import { useCallback } from 'react';
export const useMessagesService = () => {
const setMessageGroups = useSetRecoilState(messageState.messageGroups);
@@ -15,10 +14,6 @@ export const useMessagesService = () => {
const { setNotification } = useMessageNotifications();
const { t } = useTranslation();
useEffect(() => {
Nui.send('phone:fetchMessageGroups');
}, []);
const handleAddAlert = useCallback(
({ message, type }: IAlert) => {
addAlert({