fix(phone): remove checks for phoneReady

This commit is contained in:
Christopher committed 2021-05-18 13:10:48 +02:00
1 parent 346d194e97
commit 2bd4f4dc96
3 files changed
+11 -37

No files matched your search

+11 -31
View File
@@ -80,44 +80,24 @@ function Phone() {
useDialService();
const { modal: callModal } = useCallModal();
const { isPhoneReady } = usePhone();
return (
<div>
<WindowSnackbar />
<PhoneWrapper>
{isPhoneReady ? (
<NotificationBar />
<div className="PhoneAppContainer">
<>
<NotificationBar />
<div className="PhoneAppContainer">
<>
<Route exact path="/" component={HomeApp} />
{callModal && <Route exact path="/call" component={CallModal} />}
{apps.map((App) => (
<App.Route key={App.id} />
))}
</>
<NotificationAlert />
<PhoneSnackbar />
</div>
<Navigation />
<Route exact path="/" component={HomeApp} />
{callModal && <Route exact path="/call" component={CallModal} />}
{apps.map((App) => (
<App.Route key={App.id} />
))}
</>
) : (
<Box
component={Paper}
height="100%"
width="100%"
display="flex"
flexDirection="column"
alignItems="center"
justifyContent="center"
>
<Typography paragraph variant="h6">
NPWD {t('INITIALIZING')}
</Typography>
<Typography paragraph>{t('GENERIC_WAIT')}</Typography>
</Box>
)}
<NotificationAlert />
<PhoneSnackbar />
</div>
<Navigation />
</PhoneWrapper>
</div>
);
-4
View File
@@ -10,10 +10,6 @@ export const phoneState = {
key: 'resourceConfig',
default: null,
}),
phoneReady: atom<boolean>({
key: 'phoneReady',
default: false,
}),
phoneTime: atom<string>({
key: 'phoneTime',
default: null,
@@ -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);
};