diff --git a/ui/src/utils/fetchNui.ts b/ui/src/utils/fetchNui.ts index 95c2794..02c60d1 100644 --- a/ui/src/utils/fetchNui.ts +++ b/ui/src/utils/fetchNui.ts @@ -5,6 +5,8 @@ * @return returnData - A promise for the data sent back by the NuiCallbacks CB argument */ +import { isEnvBrowser } from "./misc"; + export async function fetchNui( eventName: string, data: unknown = {} @@ -17,6 +19,8 @@ export async function fetchNui( body: JSON.stringify(data), }; + if (isEnvBrowser()) return undefined as any; + const resourceName = (window as any).GetParentResourceName ? (window as any).GetParentResourceName() : "nui-frame-app";