fix(client/functions): Return right result when with hasitem callback

This commit is contained in:
BerkieBb
2022-01-11 13:49:59 +01:00
committed by GitHub
parent bfb96c2aa8
commit f69f68c7ce
+1 -5
View File
@@ -20,12 +20,8 @@ end
function QBCore.Functions.HasItem(item)
local p = promise.new()
QBCore.Functions.TriggerCallback('QBCore:HasItem', function(result)
if result then
p:resolve(true)
end
p:resolve(false)
p:resolve(result)
end, item)
return Citizen.Await(p)
end