mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
cleanup(phone/gen): Added NUI event enums for phone events
This commit is contained in:
1 parent
e6deff23da
commit
9610891a04
7 files changed
+29
-18
No files matched your search
+3
-2
@@ -33,6 +33,7 @@ import WindowSnackbar from './ui/components/WindowSnackbar';
|
||||
import { usePhone } from './os/phone/hooks/usePhone';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useSnackbar } from './ui/hooks/useSnackbar';
|
||||
import { PhoneEvents } from '../../typings/phone';
|
||||
|
||||
function Phone() {
|
||||
const { t, i18n } = useTranslation();
|
||||
@@ -154,12 +155,12 @@ export default Phone;
|
||||
InjectDebugData([
|
||||
{
|
||||
app: 'PHONE',
|
||||
method: 'setVisibility',
|
||||
method: PhoneEvents.SET_VISIBILITY,
|
||||
data: true,
|
||||
},
|
||||
{
|
||||
app: 'PHONE',
|
||||
method: 'setPhoneReady',
|
||||
method: PhoneEvents.SET_PHONE_READY,
|
||||
data: true,
|
||||
},
|
||||
]);
|
||||
@@ -1,14 +1,15 @@
|
||||
import { useSetRecoilState } from 'recoil';
|
||||
import { phoneState } from './state';
|
||||
import { useNuiEvent } from '../../nui-events/hooks/useNuiEvent';
|
||||
import { PhoneEvents } from '../../../../../typings/phone';
|
||||
|
||||
export const usePhoneService = () => {
|
||||
const setVisibility = useSetRecoilState(phoneState.visibility);
|
||||
const setPhoneConfig = useSetRecoilState(phoneState.phoneConfig);
|
||||
const setPhoneReady = useSetRecoilState(phoneState.phoneReady);
|
||||
const setPhoneTime = useSetRecoilState(phoneState.phoneTime);
|
||||
useNuiEvent('PHONE', 'setVisibility', setVisibility);
|
||||
useNuiEvent('PHONE', 'setPhoneReady', setPhoneReady);
|
||||
useNuiEvent('PHONE', 'phoneConfig', setPhoneConfig);
|
||||
useNuiEvent('PHONE', 'setTime', setPhoneTime);
|
||||
useNuiEvent('PHONE', PhoneEvents.SET_VISIBILITY, setVisibility);
|
||||
useNuiEvent('PHONE', PhoneEvents.SET_PHONE_READY, setPhoneReady);
|
||||
useNuiEvent('PHONE', PhoneEvents.SET_CONFIG, setPhoneConfig);
|
||||
useNuiEvent('PHONE', PhoneEvents.SET_TIME, setPhoneTime);
|
||||
};
|
||||
@@ -3,6 +3,7 @@ import { useSetRecoilState } from 'recoil';
|
||||
import { simcardState } from './state';
|
||||
import { useSimcard } from './useSimcard';
|
||||
import InjectDebugData from '../../debug/InjectDebugData';
|
||||
import { PhoneEvents } from '../../../../../typings/phone';
|
||||
|
||||
InjectDebugData([
|
||||
{
|
||||
@@ -14,6 +15,6 @@ InjectDebugData([
|
||||
|
||||
export const useSimcardService = () => {
|
||||
const setNumber = useSetRecoilState(simcardState.number);
|
||||
useNuiEvent('SIMCARD', 'setNumber', setNumber);
|
||||
useNuiEvent('SIMCARD', PhoneEvents.SET_NUMBER, setNumber);
|
||||
return useSimcard();
|
||||
};
|
||||
Reference in new issue
Block a user