@vicinae/api
    Preparing search index...

    Function confirmAlert

    • Display a confirmation dialog with a cancel and confirm options. The action is canceled if the cancel button is pressed or if the alert is dismissed for any reason.

      Parameters

      Returns Promise<boolean>

      • whether the action was confirmed.

      Calling this function when another alert is currently pending will result in the pending alert to be automatically canceled, replacing it with the new one.

      if (await confirmAlert({ title: 'Are you sure?', description: 'This can't be undone' })) {
      performDangerousAction();
      }