Any alternative for the queue() function - SweetAlert2 v11.4.8

1.1k Views Asked by At
swal.queue is not a function TypeError: swal.queue is not a function

I would like to know the ways for the alternative of queue() function because it's now removed on the newer version. I tried adding the javascript library via the tag but was not possible because it was being bundled with other js libraries in scripts.bundle.js. I'm using Metronic theme and I don't want to update the bundled scripts with the outdated version of sweetalert which still has the queue() function.

1

There are 1 best solutions below

0
On

Looks like there's no support for queuing alerts as it can be handled by Js Intervals/Promises. for example:

swal( {title: 'Modal 1', timer: 2000}).then(function(){ swal({title: 'Modal 2', timer: 2000}) })

or:

await swal({ title: 'Modal 1', timer: 2000 });

have a look here.