Merge pull request #1823 from seltonmt012/fix/callback-timeout

fix(es_extended/modules/callback): compare the promise state against its numeric value
This commit is contained in:
_Not_
2026-08-14 20:17:02 -05:00
committed by GitHub
2 changed files with 2 additions and 2 deletions
@@ -102,7 +102,7 @@ function ESX.AwaitServerCallback(eventName, ...)
-- if the server callback takes longer than 15 seconds to respond, reject the promise
SetTimeout(15000, function()
if p.state == "pending" then
if p.state == 0 then
p:reject("Server Callback Timed Out")
end
end)
@@ -107,7 +107,7 @@ function ESX.AwaitClientCallback(player, eventName, ...)
if not p then return end
SetTimeout(15000, function()
if p.state == "pending" then
if p.state == 0 then
p:reject("Server Callback Timed Out")
end
end)