Skip to content

Commit

Permalink
fix(phone/providers): resolve NUI provider context call
Browse files Browse the repository at this point in the history
forgot about our useNuiEvent context usage in NPWD
  • Loading branch information
TasoOneAsia committed Dec 31, 2021
1 parent 506afd8 commit b3b4f3a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
26 changes: 12 additions & 14 deletions phone/src/PhoneProviders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { NotificationsProvider } from '@os/notifications/providers/Notifications
import { usePhoneTheme } from '@os/phone/hooks/usePhoneTheme';
import SnackbarProvider from './os/snackbar/providers/SnackbarProvider';
import Phone from './Phone';
import { NuiProvider, useNuiEvent } from 'fivem-nui-react-lib';
import { useNuiEvent } from 'fivem-nui-react-lib';
import { SoundProvider } from '@os/sound/providers/SoundProvider';
import { RecoilRoot } from 'recoil';
import { PhoneEvents } from '@typings/phone';
Expand All @@ -30,19 +30,17 @@ export const PhoneProviders = () => {

return (
<RecoilRoot key={curChar}>
<NuiProvider resource="npwd">
<StyledEngineProvider injectFirst>
<ThemeProvider theme={currentTheme}>
<SoundProvider>
<NotificationsProvider>
<SnackbarProvider>
<Phone />
</SnackbarProvider>
</NotificationsProvider>
</SoundProvider>
</ThemeProvider>
</StyledEngineProvider>
</NuiProvider>
<StyledEngineProvider injectFirst>
<ThemeProvider theme={currentTheme}>
<SoundProvider>
<NotificationsProvider>
<SnackbarProvider>
<Phone />
</SnackbarProvider>
</NotificationsProvider>
</SoundProvider>
</ThemeProvider>
</StyledEngineProvider>
</RecoilRoot>
);
};
5 changes: 4 additions & 1 deletion phone/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { Theme as MaterialUITheme } from '@mui/material';
import { RewriteFrames } from '@sentry/integrations';
import attachWindowDebug from './os/debug/AttachWindowDebug';
import { createBrowserHistory } from 'history';
import { NuiProvider } from 'fivem-nui-react-lib';

dayjs.extend(relativeTime);
dayjs.extend(updateLocale);
Expand Down Expand Up @@ -59,7 +60,9 @@ if (process.env.NODE_ENV === 'development') {

ReactDOM.render(
<HashRouter>
<PhoneProviders />
<NuiProvider resource="npwd">
<PhoneProviders />
</NuiProvider>
</HashRouter>,
document.getElementById('root'),
);

0 comments on commit b3b4f3a

Please sign in to comment.