Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}).then((result) => {
if ((typeof result.value === 'boolean') && !result.value) {
return true;
}
if (!result.value || result.value.trim() === '') {
swal.showValidationError(t('please enter your email'));
return false;
}
Meteor.call('livechat:sendTranscript', visitor.getToken(), visitor.getRoom(), result.value, (err) => {
if (err) {
console.error(err);
}
swal({
title: t('transcript_sent'),
type: 'success',
timer: 1000,
showConfirmButton: false,
});
});
});
}
}).catch(error =>{
Swal.showValidationError(error)
})
},
setTimeout(() => {
if (email === 'taken@example.com') {
swal.showValidationError(
'This email is already taken.'
);
}
resolve();
}, 2000);
});
function receiveRecoveryScan(parsed, type) {
if(type === "contact-card" && parsed.uuid){
swal.getInput().value = parsed.uuid;
swal.clickConfirm();
} else {
swal.showValidationError("Error: Invalid QR code");
setTimeout(function(){ swal.resetValidationError() }, 2000);
}
}