mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-28 17:01:14 +00:00
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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user