mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-03 22:20:56 +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
|
* @return returnData - A promise for the data sent back by the NuiCallbacks CB argument
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { isEnvBrowser } from "./misc";
|
||||||
|
|
||||||
export async function fetchNui<T = any>(
|
export async function fetchNui<T = any>(
|
||||||
eventName: string,
|
eventName: string,
|
||||||
data: unknown = {}
|
data: unknown = {}
|
||||||
@@ -17,6 +19,8 @@ export async function fetchNui<T = any>(
|
|||||||
body: JSON.stringify(data),
|
body: JSON.stringify(data),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (isEnvBrowser()) return undefined as any;
|
||||||
|
|
||||||
const resourceName = (window as any).GetParentResourceName
|
const resourceName = (window as any).GetParentResourceName
|
||||||
? (window as any).GetParentResourceName()
|
? (window as any).GetParentResourceName()
|
||||||
: "nui-frame-app";
|
: "nui-frame-app";
|
||||||
|
|||||||
Reference in new issue
Block a user