mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 15:36:02 +01:00
fix(client/interface): cache input promise
Caching the promise into a variable allows us to set input to nil and resolve the promise after, which fixes an issue with opening 2 input dialogs back to back
This commit is contained in:
@@ -26,8 +26,8 @@ end
|
|||||||
|
|
||||||
RegisterNUICallback('inputData', function(data, cb)
|
RegisterNUICallback('inputData', function(data, cb)
|
||||||
cb(1)
|
cb(1)
|
||||||
if not input then return end
|
|
||||||
SetNuiFocus(false, false)
|
SetNuiFocus(false, false)
|
||||||
if not data then input:resolve() else input:resolve(data) end
|
local promise = input
|
||||||
input = nil
|
input = nil
|
||||||
|
promise:resolve(data)
|
||||||
end)
|
end)
|
||||||
|
|||||||
Reference in New Issue
Block a user