fix(esx_inventory): let the quantity dialog accept a corrected amount

The quantity dialog resolved its promise with nil on an invalid amount, so the
give/remove had already aborted by the time the player typed a valid value. The
dialog stayed open and a corrected amount did nothing.

Dropping the early resolve leaves the promise pending, so the same open dialog
accepts the retry and drops/gives the item. Cancel still resolves nil.

Tested on artifact 25770: entered an over-count amount, got "invalid amount",
corrected to a valid amount. Before, nothing happened; after, the item was
dropped.
This commit is contained in:
Selt
2026-07-27 20:12:50 +02:00
parent 5354e278de
commit 0fb74a74ef
-1
View File
@@ -146,7 +146,6 @@ local function openQuantityDialog(title, maxCount)
local qty = tonumber(data.value)
if not qty or qty <= 0 or qty > maxCount then
ESX.ShowNotification(TranslateCap("amount_invalid"))
p:resolve(nil)
else
menu.close()
p:resolve(qty)