From 2bd4f4dc960520c4f592ad18be9304f6cb7a2896 Mon Sep 17 00:00:00 2001 From: Christopher Date: Tue, 18 May 2021 13:10:48 +0200 Subject: [PATCH] fix(phone): remove checks for phoneReady --- phone/src/Phone.tsx | 42 ++++++--------------- phone/src/os/phone/hooks/state.ts | 4 -- phone/src/os/phone/hooks/usePhoneService.ts | 2 - 3 files changed, 11 insertions(+), 37 deletions(-) diff --git a/phone/src/Phone.tsx b/phone/src/Phone.tsx index baa5654..56ff2d4 100644 --- a/phone/src/Phone.tsx +++ b/phone/src/Phone.tsx @@ -80,44 +80,24 @@ function Phone() { useDialService(); const { modal: callModal } = useCallModal(); - const { isPhoneReady } = usePhone(); return (
- {isPhoneReady ? ( + +
<> - -
- <> - - {callModal && } - {apps.map((App) => ( - - ))} - - - -
- + + {callModal && } + {apps.map((App) => ( + + ))} - ) : ( - - - NPWD {t('INITIALIZING')} - - {t('GENERIC_WAIT')} - - )} + + +
+
); diff --git a/phone/src/os/phone/hooks/state.ts b/phone/src/os/phone/hooks/state.ts index 0b42183..abf1cb2 100644 --- a/phone/src/os/phone/hooks/state.ts +++ b/phone/src/os/phone/hooks/state.ts @@ -10,10 +10,6 @@ export const phoneState = { key: 'resourceConfig', default: null, }), - phoneReady: atom({ - key: 'phoneReady', - default: false, - }), phoneTime: atom({ key: 'phoneTime', default: null, diff --git a/phone/src/os/phone/hooks/usePhoneService.ts b/phone/src/os/phone/hooks/usePhoneService.ts index df0dd5d..20d3ef3 100644 --- a/phone/src/os/phone/hooks/usePhoneService.ts +++ b/phone/src/os/phone/hooks/usePhoneService.ts @@ -6,10 +6,8 @@ import { phoneState } from './state'; export const usePhoneService = () => { const setVisibility = useSetRecoilState(phoneState.visibility); const setResourceConfig = useSetRecoilState(phoneState.resourceConfig); - const setPhoneReady = useSetRecoilState(phoneState.phoneReady); const setPhoneTime = useSetRecoilState(phoneState.phoneTime); useNuiEvent('PHONE', PhoneEvents.SET_VISIBILITY, setVisibility); - useNuiEvent('PHONE', PhoneEvents.SET_PHONE_READY, setPhoneReady); useNuiEvent('PHONE', PhoneEvents.SET_CONFIG, setResourceConfig); useNuiEvent('PHONE', PhoneEvents.SET_TIME, setPhoneTime); };