Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package/client/resource/interface/alert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ interface AlertDialogProps {
};
}

type alertDialog = (data: AlertDialogProps) => Promise<'cancel' | 'confirm'>;
type alertDialog = (data: AlertDialogProps) => Promise<'cancel' | 'confirm' | 'timeout' | undefined>;

export const alertDialog: alertDialog = async (data, timeout?: number) =>
await exports.ox_lib.alertDialog(data, timeout);
Expand Down
6 changes: 3 additions & 3 deletions resource/interface/client/alert.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ local alertId = 0

---@param data AlertDialogProps
---@param timeout? number Force the window to timeout after `x` milliseconds.
---@return 'cancel' | 'confirm' | nil
---@return 'cancel' | 'confirm' | 'timeout' | nil
function lib.alertDialog(data, timeout)
if alert then return end

Expand Down Expand Up @@ -53,10 +53,10 @@ function lib.closeAlertDialog(reason)
action = 'closeAlertDialog'
})

local p = alert
local _alert = alert
alert = nil

if reason then p:reject(reason) else p:resolve() end
_alert:resolve(reason)
end

RegisterNUICallback('closeAlert', function(data, cb)
Expand Down