Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
onInfoButtonTap(contactInfo: ContactInfo) {
const phone = contactInfo.displayString.replace(/\s/g, "");
if (contactInfo.type === 0) {
phoneModule.dial(phone, true);
} else if (contactInfo.type === 1) {
phoneModule.sms([phone], "");
} else {
const composeOptions: email.ComposeOptions = {
to: [contactInfo.displayString]
};
email.available().then((available: boolean) => {
if (available) {
email.compose(composeOptions);
}
});
}
}
}