Skip to content
This repository was archived by the owner on Apr 29, 2025. It is now read-only.

Commit 8509867

Browse files
committed
refactor(callback/client): require source in response handler
1 parent 6fcb831 commit 8509867

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

imports/callback/client.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ local cbEvent = '__ox_cb_%s'
44
local callbackTimeout = GetConvarInt('ox:callbackTimeout', 300000)
55

66
RegisterNetEvent(cbEvent:format(cache.resource), function(key, ...)
7+
if source == '' then return end
8+
79
local cb = pendingCallbacks[key]
810

911
if not cb then return end

package/client/resource/callback/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ const pendingCallbacks: Record<string, (...args: any[]) => void> = {};
44
const callbackTimeout = GetConvarInt('ox:callbackTimeout', 300000);
55

66
onNet(`__ox_cb_${cache.resource}`, (key: string, ...args: any) => {
7+
if (!source) return;
8+
79
const resolve = pendingCallbacks[key];
810

911
if (!resolve) return;

0 commit comments

Comments
 (0)