mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 23:16:03 +01:00
fix(client/context): hide before triggering select actions
This commit is contained in:
@@ -32,6 +32,8 @@ local function closeContext(_, cb, onExit)
|
||||
|
||||
lib.resetNuiFocus()
|
||||
|
||||
if not openContextMenu then return end
|
||||
|
||||
if (cb or onExit) and contextMenus[openContextMenu].onExit then contextMenus[openContextMenu].onExit() end
|
||||
|
||||
if not cb then SendNUIMessage({ action = 'hideContext' }) end
|
||||
@@ -98,15 +100,11 @@ RegisterNUICallback('clickContext', function(id, cb)
|
||||
|
||||
openContextMenu = nil
|
||||
|
||||
lib.resetNuiFocus()
|
||||
SendNUIMessage({ action = 'hideContext' })
|
||||
|
||||
if data.onSelect then data.onSelect(data.args) end
|
||||
if data.event then TriggerEvent(data.event, data.args) end
|
||||
if data.serverEvent then TriggerServerEvent(data.serverEvent, data.args) end
|
||||
|
||||
SendNUIMessage({
|
||||
action = 'hideContext'
|
||||
})
|
||||
end)
|
||||
|
||||
RegisterNUICallback('closeContext', closeContext)
|
||||
|
||||
Reference in New Issue
Block a user