From e3500cb84873551b821f1afc26ed61d5d499cd21 Mon Sep 17 00:00:00 2001 From: itschip Date: Mon, 1 Jan 2024 19:11:00 +0100 Subject: [PATCH] chore(apps): uhm, small changes --- apps/game/server/bridge/qbx/qbx-server.ts | 6 +++--- apps/game/server/server.ts | 4 +--- apps/phone/src/common/hooks/useExternalApps.tsx | 5 ++--- apps/phone/src/common/hooks/useNuiEvent.ts | 2 +- apps/phone/src/os/apps/utils/externalAppBoundary.tsx | 1 + 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/apps/game/server/bridge/qbx/qbx-server.ts b/apps/game/server/bridge/qbx/qbx-server.ts index 91ae86d9e..990432d90 100644 --- a/apps/game/server/bridge/qbx/qbx-server.ts +++ b/apps/game/server/bridge/qbx/qbx-server.ts @@ -30,9 +30,9 @@ export class QBXFramework implements Strategy { }); }); - on("QBCore:Server:OnPlayerUnload", async () => { + on('QBCore:Server:OnPlayerUnload', async () => { await PlayerService.handleUnloadPlayerEvent(global.source); - }) + }); } onStart(): void { @@ -53,4 +53,4 @@ export class QBXFramework implements Strategy { } }); } -} \ No newline at end of file +} diff --git a/apps/game/server/server.ts b/apps/game/server/server.ts index 92d8a21e0..d042cc8a1 100644 --- a/apps/game/server/server.ts +++ b/apps/game/server/server.ts @@ -6,9 +6,7 @@ import { config as resourceConfig } from '@npwd/config/server'; export const config = resourceConfig; import { registerCommands } from './commands/registerCommands'; - -console.log(config); - +// This is ugly as fuck and we need to import things in a order that makes sense // Setup controllers // //import './db/pool'; diff --git a/apps/phone/src/common/hooks/useExternalApps.tsx b/apps/phone/src/common/hooks/useExternalApps.tsx index 7236ac20e..99abba61a 100644 --- a/apps/phone/src/common/hooks/useExternalApps.tsx +++ b/apps/phone/src/common/hooks/useExternalApps.tsx @@ -9,10 +9,9 @@ import { __federation_method_getRemote, __federation_method_setRemote, __federation_method_unwrapDefault, - // @ts-ignore - This is Vite federation magic + // @ts-ignore - This is virtual modules from the vite plugin. I guess they forgot to add defs. } from '__federation__'; import { EnvMode } from '@utils/config'; -import { NuiProvider } from 'fivem-nui-react-lib'; const useExternalAppsAction = () => { const loadScript = async (url: string) => { @@ -59,7 +58,7 @@ const useExternalAppsAction = () => { const appConfig = m(); const config = appConfig; - config.Component = (props: object) => React.createElement(config.app); + config.Component = (props: object) => React.createElement(config.app, props); const Provider = createExternalAppProvider(config); diff --git a/apps/phone/src/common/hooks/useNuiEvent.ts b/apps/phone/src/common/hooks/useNuiEvent.ts index ea80c5f69..94670609e 100644 --- a/apps/phone/src/common/hooks/useNuiEvent.ts +++ b/apps/phone/src/common/hooks/useNuiEvent.ts @@ -46,4 +46,4 @@ export const useNuiEvent = (app: string, action: string, handler: (data // Remove Event Listener on component cleanup return () => window.removeEventListener('message', eventListener); }, [action, app]); -}; +}; \ No newline at end of file diff --git a/apps/phone/src/os/apps/utils/externalAppBoundary.tsx b/apps/phone/src/os/apps/utils/externalAppBoundary.tsx index 29ae422a4..8873871e9 100644 --- a/apps/phone/src/os/apps/utils/externalAppBoundary.tsx +++ b/apps/phone/src/os/apps/utils/externalAppBoundary.tsx @@ -39,6 +39,7 @@ const Container = styled.div<{ background: string; color: string }>` `; interface ExternalAppBoundaryProps { + children: React.ReactNode; color: string; background: string; t: TFunction;