mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 06:56:03 +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)
|
||||
cb(1)
|
||||
if not input then return end
|
||||
SetNuiFocus(false, false)
|
||||
if not data then input:resolve() else input:resolve(data) end
|
||||
local promise = input
|
||||
input = nil
|
||||
promise:resolve(data)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user