You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been having a problem after I hide my menu and check if it is open, it's having and a delay and making it bug whenever I try to show the menu right after I hide it.
I think it will be better synced with this script below
Replace this
function lib.hideMenu(onExit)
local menu = openMenu
openMenu = nil
if not menu then return end
lib.resetNuiFocus()
if onExit and menu.onClose then
menu.onClose()
end
SendNUIMessage({
action = 'closeMenu'
})
end
With this:
local ExitFunction, closing = false, false
function lib.hideMenu(onExit)
if closing or not openMenu then return end
closing = true
ExitFunction = onExit
SendNUIMessage({
action = 'closeMenu'
})
end
RegisterNUICallback('closed', function()
if not openMenu then return end
local menu = openMenu
openMenu = nil
closing = false
lib.resetNuiFocus()
if ExitFunction then
menu.onClose()
end
ExitFunction = false
end)
And add something on js to trigger that callback after the menu is closed
The text was updated successfully, but these errors were encountered:
I've been having a problem after I hide my menu and check if it is open, it's having and a delay and making it bug whenever I try to show the menu right after I hide it.
I think it will be better synced with this script below
Replace this
With this:
And add something on js to trigger that callback after the menu is closed
The text was updated successfully, but these errors were encountered: