mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 06:56:03 +01:00
feat(interface/alert): support dialog timeout
closeAlertDialog will now error if a reason is passed. Added timeout param to alertDialog. Resolves #522.
This commit is contained in:
@@ -13,6 +13,7 @@ interface AlertDialogProps {
|
||||
|
||||
type alertDialog = (data: AlertDialogProps) => Promise<'cancel' | 'confirm'>;
|
||||
|
||||
export const alertDialog: alertDialog = async (data) => await exports.ox_lib.alertDialog(data);
|
||||
export const alertDialog: alertDialog = async (data, timeout?: number) =>
|
||||
await exports.ox_lib.alertDialog(data, timeout);
|
||||
|
||||
export const closeAlertDialog = () => exports.ox_lib.closeAlertDialog();
|
||||
export const closeAlertDialog = (reason?: string) => exports.ox_lib.closeAlertDialog(reason);
|
||||
|
||||
Reference in New Issue
Block a user