Sometimes when opening an inventory the NUI focus is lost, having no cursor while the inventory is visible.
Reproduction
Using the txAdminRecipe 2.2.4
Enter the default qb-traphouse. Use the 'Take Over ($5000)'. Then press View Inventory.
Expected behavior
Expected the inventory to have NUI focus.
Actual behavior
The inventory does not have NUI focus.
Additional context
Pressing 'View Inventory' triggers qb-traphouse:client:target:ViewInventory, which in turn triggers inventory:server:OpenInventory. This server event triggers the following two client events
To these client events I have added logs to track the flow.
As you can see the events as well as the js code they are calling are handled in the order they are executed, qb-inventory:client:closeinv first then inventory:client:OpenInventory. Except the Inventory.Close javascript functions calls the callback https://qb-inventory/CloseInventory which executes after the inventory had already opened. This causes a race condition.
This bug was introduced two months ago by this commit.
Summary
Sometimes when opening an inventory the NUI focus is lost, having no cursor while the inventory is visible.
Reproduction
Using the txAdminRecipe 2.2.4
Enter the default qb-traphouse. Use the 'Take Over ($5000)'. Then press View Inventory.
Expected behavior
Expected the inventory to have NUI focus.
Actual behavior
The inventory does not have NUI focus.
Additional context
Pressing 'View Inventory' triggers
qb-traphouse:client:target:ViewInventory
, which in turn triggersinventory:server:OpenInventory
. This server event triggers the following two client eventsTo these client events I have added logs to track the flow.
As you can see the events as well as the js code they are calling are handled in the order they are executed,
qb-inventory:client:closeinv
first theninventory:client:OpenInventory
. Except theInventory.Close
javascript functions calls the callbackhttps://qb-inventory/CloseInventory
which executes after the inventory had already opened. This causes a race condition.This bug was introduced two months ago by this commit.
Last Updated
Yesterday
Custom Resources
No
Resource Rename
No