Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.catch(error => {
swal.showValidationMessage(
`Request failed: ${error}`
)
})
},
}).then(() => true).catch(err => {
Swal.showValidationMessage(err);
});
}
preConfirm: amount => {
if(isNaN(amount) || amount <= 0) {
Swal.showValidationMessage('Invalid tip amount provided');
return false;
}
return Utils.contract.tipMessage(+messageID).send({
callValue: Number(amount) * 1000000
}).then(() => true).catch(err => {
Swal.showValidationMessage(err);
});
}
});