project-error / npwd

NPWD is a FiveM phone resource written entirely in TypeScript and React.
https://projecterror.dev
Other
351 stars 275 forks source link

Fix: Add isEnvBrowser check for running app in dev mode #1024

Closed BackSH00TER closed 1 year ago

BackSH00TER commented 1 year ago

Pull Request Description

If you run the app from apps/phone and use yarn dev you can develop the app in the browser.

Currently the phone will never appear on the screen. This is because the usePhoneVisibility() hook positions the phone off screen so that when you are in game the phone only shows when its opened. When in the dev/browser mode we want the phone to always show. Added a check for isEnvBrowser to know if we are in game vs the browser, and if in browser we do not position the phone off screen.

Ex: Phone displays correctly in browser image

Pull Request Checklist: