Skip to content

Commit

Permalink
tweak: small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tabarra committed Jan 13, 2024
1 parent 52a857a commit a51bd05
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions nui/src/hooks/useExitListener.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const useExitListener = () => {

setVisible(false);
fetchNui("closeMenu");
fetchNui("playSound", "enter");
}
};

Expand Down
2 changes: 1 addition & 1 deletion nui/src/hooks/useNuiListenersService.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ export const useNuiListenerService = () => {
useNuiEvent<ServerCtx>("setServerCtx", setServerCtxState);
useNuiEvent<txAdminMenuPage>("setMenuPage", setMenuPage);
useNuiEvent("resetSession", ()=>{
fetchWebPipe<string>("/resetSession").catch();
fetchWebPipe<string>("/nui/resetSession").catch();
});
};
4 changes: 2 additions & 2 deletions panel/src/layout/playerModal/HistoryTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ function HistoryItem({ action, permsDisableWarn, permsDisableBan, serverTime, do
if (action.revokedBy) {
borderColorClass = '';
const revocationDate = tsToLocaleDateTime(action.revokedAt ?? 0, 'medium', 'short');
footerNote = `Revoked by ${action.revokedBy} in ${revocationDate}.`;
footerNote = `Revoked by ${action.revokedBy} on ${revocationDate}.`;
} else if (typeof action.exp === 'number') {
const expirationDate = tsToLocaleDateTime(action.exp, 'medium', 'short');
footerNote = (action.exp < serverTime) ? `Expired in ${expirationDate}.` : `Expires in ${expirationDate}.`;
footerNote = (action.exp < serverTime) ? `Expired on ${expirationDate}.` : `Expires in ${expirationDate}.`;
}

return (
Expand Down
7 changes: 4 additions & 3 deletions resource/menu/client/cl_base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ RegisterSecureNuiCallback('closeMenu', function(_, cb)
debugPrint('Releasing all NUI Focus')
SetNuiFocus(false)
SetNuiFocusKeepInput(false)
playLibrarySound('enter')
cb({})
end)

Expand All @@ -200,9 +201,9 @@ RegisterNetEvent('txcl:heal', function()
ClearPedBloodDamage(ped)
RestorePlayerStamina(PlayerId(), 100.0)
if IS_REDM then
Citizen.InvokeNative(0xC6258F41D86676E0, ped, 0, 100) -- SetAttributeCoreValue
Citizen.InvokeNative(0xC6258F41D86676E0, ped, 1, 100) -- SetAttributeCoreValue
Citizen.InvokeNative(0xC6258F41D86676E0, ped, 2, 100) -- SetAttributeCoreValue
Citizen.InvokeNative(0xC6258F41D86676E0, ped, 0, 100) -- SetAttributeCoreValue
Citizen.InvokeNative(0xC6258F41D86676E0, ped, 1, 100) -- SetAttributeCoreValue
Citizen.InvokeNative(0xC6258F41D86676E0, ped, 2, 100) -- SetAttributeCoreValue
end
end)

Expand Down
5 changes: 3 additions & 2 deletions resource/menu/client/cl_webpipe.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ RegisterRawNuiCallback('WebPipe', function(req, cb)
end

-- Cookie wiper to prevent sticky cookie sessions after reauth
-- FIXME: deprecate this path?!
if path == '/nui/resetSession' then
if type(headers['Cookie']) ~= 'string' then
return cb({
Expand All @@ -55,8 +56,8 @@ RegisterRawNuiCallback('WebPipe', function(req, cb)
})
else
local cookies = {}
for cookie in headers['Cookie']:gmatch('(tx:[^=]+)') do
cookies[#cookies +1] = cookie.."=deleted; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT; httponly; SameSite=None; Secure"
for cookie in headers['Cookie']:gmatch('(tx:[^=]+)') do
cookies[#cookies + 1] = cookie .. "=deleted; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT; httponly; SameSite=None; Secure"
end
return cb({
status = 200,
Expand Down

0 comments on commit a51bd05

Please sign in to comment.