From 82d052a1bb068eaeb24faebf80b547ce5dfa9206 Mon Sep 17 00:00:00 2001 From: Luke Date: Wed, 17 Aug 2022 23:42:36 +0200 Subject: [PATCH] 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 --- resource/interface/client/input.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resource/interface/client/input.lua b/resource/interface/client/input.lua index 28c8666..63152b3 100644 --- a/resource/interface/client/input.lua +++ b/resource/interface/client/input.lua @@ -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)