Skip to content

Commit

Permalink
chore(base): default phone to visible mode in dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
antonstjernquist committed Sep 11, 2024
1 parent 341578b commit a0c3fbe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { setTheme } from './utils/theme';
import { Footer } from './components/Main/Footer';
import { Header } from './components/Main/Header';
import { useNuiEvent } from 'react-fivem-hooks';
import { isEnvBrowser } from './utils/game';

export const lightTheme = {
textColor: {
Expand Down Expand Up @@ -38,7 +39,7 @@ function App() {

const { data: isOpen } = useNuiEvent<boolean>({
event: 'SET_PHONE_OPEN',
defaultValue: false,
defaultValue: isEnvBrowser(),
});

if (!isOpen) {
Expand Down
2 changes: 2 additions & 0 deletions src/ui/src/utils/game.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const isEnvBrowser = (): boolean =>
!(window as unknown as { invokeNative: CallableFunction }).invokeNative;

0 comments on commit a0c3fbe

Please sign in to comment.