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:
Luke
2022-08-17 23:42:36 +02:00
parent 0e7bd1a177
commit 82d052a1bb

View File

@@ -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)