mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-01 14:38:50 +00:00
fix(ui): Don't display failed fetches in browser
This commit is contained in:
1 parent
5eaed9f87b
commit
49bf5bb3ce
1 file changed
+4
@@ -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<T = any>(
|
||||
eventName: string,
|
||||
data: unknown = {}
|
||||
@@ -17,6 +19,8 @@ export async function fetchNui<T = any>(
|
||||
body: JSON.stringify(data),
|
||||
};
|
||||
|
||||
if (isEnvBrowser()) return undefined as any;
|
||||
|
||||
const resourceName = (window as any).GetParentResourceName
|
||||
? (window as any).GetParentResourceName()
|
||||
: "nui-frame-app";
|
||||
|
||||
Reference in new issue
Block a user