Closed Snickbrack closed 6 years ago
I have this function:
queueSwalToast: function (toastType, toastText) { //if toast is already shown then call setTimeout for a time 500 ms after the removal of the previous toast var timerEndTime = 3000; const toast = swal.mixin({ toast: true, position: 'top-end', showConfirmButton: false, timer: timerEndTime }); if (GlobalVariables._currentSwalEndTime != 0) { setTimeout(function () { if (!swal.isVisible()) { console.log(swal.isVisible()); toast({ type: toastType, title: toastText }) GlobalVariables._currentSwalEndTime = Date.now() + timerEndTime; } }, GlobalVariables._currentSwalEndTime - Date.now() + 500); } else { if (!swal.isVisible()) { console.log(swal.isVisible()); toast({ type: toastType, title: toastText }) GlobalVariables._currentSwalEndTime = Date.now() + timerEndTime; } } }
Which queues swal's by endtime. If I now create a normal swal for data presentation it does adopt the timer "endtime" of the former swal toast.
Swal code:
var inputOptions = new Promise((resolve) => { resolve(_markets) }) const {value: _marketID} = await swal({ title: 'Markt auswählen', input: 'radio', inputOptions: inputOptions, inputValidator: (value) => { return !value && 'Bitte einen Markt auswählen!' } })
If the new swal is created it auto-closes after 1-2 Seconds which could be the endtime of the toast swal.
But why?
Wrong repo, the issue should be reported here: https://github.com/sweetalert2/sweetalert2/issues
I have this function:
Which queues swal's by endtime. If I now create a normal swal for data presentation it does adopt the timer "endtime" of the former swal toast.
Swal code:
If the new swal is created it auto-closes after 1-2 Seconds which could be the endtime of the toast swal.
But why?